mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
rebase tests: mark tests specific to the am-backend with --am
We have many rebase tests in the testsuite, and often the same test is repeated multiple times just testing different backends. For those tests that were specifically trying to test the am backend, add the --am flag. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c2417d3af7
commit
980b482d28
|
@ -183,19 +183,19 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea
|
|||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg' '
|
||||
test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--am)' '
|
||||
git checkout -B default-base master &&
|
||||
git checkout -B default topic &&
|
||||
git config branch.default.remote . &&
|
||||
git config branch.default.merge refs/heads/default-base &&
|
||||
git rebase &&
|
||||
git rebase --am &&
|
||||
git rev-parse --verify default-base >expect &&
|
||||
git rev-parse default~1 >actual &&
|
||||
test_cmp expect actual &&
|
||||
git checkout default-base &&
|
||||
git reset --hard HEAD^ &&
|
||||
git checkout default &&
|
||||
git rebase &&
|
||||
git rebase --am &&
|
||||
git rev-parse --verify default-base >expect &&
|
||||
git rev-parse default~1 >actual &&
|
||||
test_cmp expect actual
|
||||
|
@ -226,7 +226,7 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
|
|||
|
||||
test_expect_success 'rebase --am -q is quiet' '
|
||||
git checkout -b quiet topic &&
|
||||
git rebase -q master >output.out 2>&1 &&
|
||||
git rebase --am -q master >output.out 2>&1 &&
|
||||
test_must_be_empty output.out
|
||||
'
|
||||
|
||||
|
@ -325,7 +325,7 @@ test_expect_success 'rebase --am and --show-current-patch' '
|
|||
echo two >>init.t &&
|
||||
git commit -a -m two &&
|
||||
git tag two &&
|
||||
test_must_fail git rebase -f --onto init HEAD^ &&
|
||||
test_must_fail git rebase --am -f --onto init HEAD^ &&
|
||||
GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&
|
||||
grep "show.*$(git rev-parse two)" stderr
|
||||
)
|
||||
|
|
|
@ -52,13 +52,13 @@ test_expect_success 'rebase --interactive: directory rename detected' '
|
|||
)
|
||||
'
|
||||
|
||||
test_expect_failure 'rebase (am): directory rename detected' '
|
||||
test_expect_failure 'rebase --am: directory rename detected' '
|
||||
(
|
||||
cd dir-rename &&
|
||||
|
||||
git checkout B^0 &&
|
||||
|
||||
git -c merge.directoryRenames=true rebase A &&
|
||||
git -c merge.directoryRenames=true rebase --am A &&
|
||||
|
||||
git ls-files -s >out &&
|
||||
test_line_count = 5 out &&
|
||||
|
|
|
@ -1138,7 +1138,7 @@ test_expect_success C_LOCALE_OUTPUT 'rebase --edit-todo does not work on non-int
|
|||
git checkout conflict-branch &&
|
||||
(
|
||||
set_fake_editor &&
|
||||
test_must_fail git rebase -f --onto HEAD~2 HEAD~ &&
|
||||
test_must_fail git rebase -f --am --onto HEAD~2 HEAD~ &&
|
||||
test_must_fail git rebase --edit-todo
|
||||
) &&
|
||||
git rebase --abort
|
||||
|
|
|
@ -23,24 +23,24 @@ test_expect_success 'rebase -m' '
|
|||
'
|
||||
|
||||
test_expect_success 'rebase against master twice' '
|
||||
git rebase master >out &&
|
||||
git rebase --am master >out &&
|
||||
test_i18ngrep "Current branch topic is up to date" out
|
||||
'
|
||||
|
||||
test_expect_success 'rebase against master twice with --force' '
|
||||
git rebase --force-rebase master >out &&
|
||||
git rebase --force-rebase --am master >out &&
|
||||
test_i18ngrep "Current branch topic is up to date, rebase forced" out
|
||||
'
|
||||
|
||||
test_expect_success 'rebase against master twice from another branch' '
|
||||
git checkout topic^ &&
|
||||
git rebase master topic >out &&
|
||||
git rebase --am master topic >out &&
|
||||
test_i18ngrep "Current branch topic is up to date" out
|
||||
'
|
||||
|
||||
test_expect_success 'rebase fast-forward to master' '
|
||||
git checkout topic^ &&
|
||||
git rebase topic >out &&
|
||||
git rebase --am topic >out &&
|
||||
test_i18ngrep "Fast-forwarded HEAD to topic" out
|
||||
'
|
||||
|
||||
|
@ -89,7 +89,7 @@ test_expect_success 'GIT_REFLOG_ACTION' '
|
|||
git checkout -b reflog-topic start &&
|
||||
test_commit reflog-to-rebase &&
|
||||
|
||||
git rebase reflog-onto &&
|
||||
git rebase --am reflog-onto &&
|
||||
git log -g --format=%gs -3 >actual &&
|
||||
cat >expect <<-\EOF &&
|
||||
rebase finished: returning to refs/heads/reflog-topic
|
||||
|
@ -99,7 +99,7 @@ test_expect_success 'GIT_REFLOG_ACTION' '
|
|||
test_cmp expect actual &&
|
||||
|
||||
git checkout -b reflog-prefix reflog-to-rebase &&
|
||||
GIT_REFLOG_ACTION=change-the-reflog git rebase reflog-onto &&
|
||||
GIT_REFLOG_ACTION=change-the-reflog git rebase --am reflog-onto &&
|
||||
git log -g --format=%gs -3 >actual &&
|
||||
cat >expect <<-\EOF &&
|
||||
rebase finished: returning to refs/heads/reflog-prefix
|
||||
|
|
|
@ -96,14 +96,14 @@ testrebase() {
|
|||
'
|
||||
}
|
||||
|
||||
testrebase "" .git/rebase-apply
|
||||
testrebase " --am" .git/rebase-apply
|
||||
testrebase " --merge" .git/rebase-merge
|
||||
|
||||
test_expect_success 'rebase --quit' '
|
||||
test_expect_success 'rebase --am --quit' '
|
||||
cd "$work_dir" &&
|
||||
# Clean up the state from the previous one
|
||||
git reset --hard pre-rebase &&
|
||||
test_must_fail git rebase master &&
|
||||
test_must_fail git rebase --am master &&
|
||||
test_path_is_dir .git/rebase-apply &&
|
||||
head_before=$(git rev-parse HEAD) &&
|
||||
git rebase --quit &&
|
||||
|
|
|
@ -234,7 +234,7 @@ test_expect_success "rebase: noop rebase" '
|
|||
git checkout feature-branch
|
||||
'
|
||||
|
||||
testrebase "" .git/rebase-apply
|
||||
testrebase " --am" .git/rebase-apply
|
||||
testrebase " --merge" .git/rebase-merge
|
||||
testrebase " --interactive" .git/rebase-merge
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd e' c..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -50,7 +50,7 @@ test_run_rebase () {
|
|||
test_cmp_rev e HEAD
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -66,7 +66,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd e' b..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success --fork-point
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
|
@ -83,7 +83,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd e' branch-b..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success --fork-point
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
|
@ -98,7 +98,7 @@ test_run_rebase () {
|
|||
test_cmp_rev e HEAD
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success --fork-point
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
|
@ -139,7 +139,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd i' h..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -154,7 +154,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd' h..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -169,7 +169,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd i' f..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -184,7 +184,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd gp i' h..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -212,7 +212,7 @@ test_run_rebase () {
|
|||
test_linear_range 'j d k l' c..
|
||||
"
|
||||
}
|
||||
test_run_rebase failure ''
|
||||
test_run_rebase failure --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase failure -p
|
||||
|
@ -227,7 +227,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd k l' c..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -242,7 +242,7 @@ test_run_rebase () {
|
|||
test_linear_range 'd k l' j..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -282,7 +282,7 @@ test_run_rebase () {
|
|||
test_linear_range 'x y' c..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -297,7 +297,7 @@ test_run_rebase () {
|
|||
test_linear_range 'x y' c..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase failure -p
|
||||
|
@ -312,7 +312,7 @@ test_run_rebase () {
|
|||
test_linear_range 'x y' m..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase success -p
|
||||
|
@ -328,7 +328,7 @@ test_run_rebase () {
|
|||
"
|
||||
}
|
||||
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase failure -p
|
||||
|
@ -343,7 +343,7 @@ test_run_rebase () {
|
|||
test_linear_range 'x y' m..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
test_have_prereq !REBASE_P || test_run_rebase failure -p
|
||||
|
|
|
@ -54,7 +54,7 @@ test_run_rebase () {
|
|||
test_linear_range 'n o' e..
|
||||
"
|
||||
}
|
||||
test_run_rebase success ''
|
||||
test_run_rebase success --am
|
||||
test_run_rebase success -m
|
||||
test_run_rebase success -i
|
||||
|
||||
|
@ -70,7 +70,7 @@ test_run_rebase () {
|
|||
test_linear_range "\'"$expected"\'" d..
|
||||
"
|
||||
}
|
||||
test_run_rebase success 'n o e' ''
|
||||
test_run_rebase success 'n o e' --am
|
||||
test_run_rebase success 'n o e' -m
|
||||
test_run_rebase success 'n o e' -i
|
||||
|
||||
|
@ -86,7 +86,7 @@ test_run_rebase () {
|
|||
test_linear_range "\'"$expected"\'" c..
|
||||
"
|
||||
}
|
||||
test_run_rebase success 'd n o e' ''
|
||||
test_run_rebase success 'd n o e' --am
|
||||
test_run_rebase success 'd n o e' -m
|
||||
test_run_rebase success 'd n o e' -i
|
||||
|
||||
|
@ -102,7 +102,7 @@ test_run_rebase () {
|
|||
test_linear_range "\'"$expected"\'" c..
|
||||
"
|
||||
}
|
||||
test_run_rebase success 'd n o e' ''
|
||||
test_run_rebase success 'd n o e' --am
|
||||
test_run_rebase success 'd n o e' -m
|
||||
test_run_rebase success 'd n o e' -i
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ test_rebase_same_head () {
|
|||
shift &&
|
||||
cmp_f="$1" &&
|
||||
shift &&
|
||||
test_rebase_same_head_ $status_n $what_n $cmp_n "" "$*" &&
|
||||
test_rebase_same_head_ $status_f $what_f $cmp_f " --no-ff" "$*"
|
||||
test_rebase_same_head_ $status_n $what_n $cmp_n " --am" "$*" &&
|
||||
test_rebase_same_head_ $status_f $what_f $cmp_f " --am --no-ff" "$*"
|
||||
test_rebase_same_head_ $status_n $what_n $cmp_n " --merge" "$*" &&
|
||||
test_rebase_same_head_ $status_f $what_f $cmp_f " --merge --no-ff" "$*"
|
||||
}
|
||||
|
|
|
@ -53,10 +53,10 @@ test_expect_success 'git commit --amend --no-post-rewrite' '
|
|||
test ! -f post-rewrite.data
|
||||
'
|
||||
|
||||
test_expect_success 'git rebase' '
|
||||
test_expect_success 'git rebase --am' '
|
||||
git reset --hard D &&
|
||||
clear_hook_input &&
|
||||
test_must_fail git rebase --onto A B &&
|
||||
test_must_fail git rebase --am --onto A B &&
|
||||
echo C > foo &&
|
||||
git add foo &&
|
||||
git rebase --continue &&
|
||||
|
@ -68,10 +68,10 @@ test_expect_success 'git rebase' '
|
|||
verify_hook_input
|
||||
'
|
||||
|
||||
test_expect_success 'git rebase --skip' '
|
||||
test_expect_success 'git rebase --am --skip' '
|
||||
git reset --hard D &&
|
||||
clear_hook_input &&
|
||||
test_must_fail git rebase --onto A B &&
|
||||
test_must_fail git rebase --am --onto A B &&
|
||||
test_must_fail git rebase --skip &&
|
||||
echo D > foo &&
|
||||
git add foo &&
|
||||
|
@ -84,10 +84,10 @@ test_expect_success 'git rebase --skip' '
|
|||
verify_hook_input
|
||||
'
|
||||
|
||||
test_expect_success 'git rebase --skip the last one' '
|
||||
test_expect_success 'git rebase --am --skip the last one' '
|
||||
git reset --hard F &&
|
||||
clear_hook_input &&
|
||||
test_must_fail git rebase --onto D A &&
|
||||
test_must_fail git rebase --am --onto D A &&
|
||||
git rebase --skip &&
|
||||
echo rebase >expected.args &&
|
||||
cat >expected.data <<-EOF &&
|
||||
|
|
|
@ -71,10 +71,10 @@ test_expect_success 'prepare for rebase conflicts' '
|
|||
'
|
||||
|
||||
|
||||
test_expect_success 'status when rebase in progress before resolving conflicts' '
|
||||
test_expect_success 'status when rebase --am in progress before resolving conflicts' '
|
||||
test_when_finished "git rebase --abort" &&
|
||||
ONTO=$(git rev-parse --short HEAD^^) &&
|
||||
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
|
||||
test_must_fail git rebase --am HEAD^ --onto HEAD^^ &&
|
||||
cat >expected <<EOF &&
|
||||
rebase in progress; onto $ONTO
|
||||
You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
|
||||
|
@ -94,11 +94,11 @@ EOF
|
|||
'
|
||||
|
||||
|
||||
test_expect_success 'status when rebase in progress before rebase --continue' '
|
||||
test_expect_success 'status when rebase --am in progress before rebase --continue' '
|
||||
git reset --hard rebase_conflicts &&
|
||||
test_when_finished "git rebase --abort" &&
|
||||
ONTO=$(git rev-parse --short HEAD^^) &&
|
||||
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
|
||||
test_must_fail git rebase --am HEAD^ --onto HEAD^^ &&
|
||||
echo three >main.txt &&
|
||||
git add main.txt &&
|
||||
cat >expected <<EOF &&
|
||||
|
@ -688,7 +688,7 @@ EOF
|
|||
'
|
||||
|
||||
|
||||
test_expect_success 'status when rebase conflicts with statushints disabled' '
|
||||
test_expect_success 'status when rebase --am conflicts with statushints disabled' '
|
||||
git reset --hard master &&
|
||||
git checkout -b statushints_disabled &&
|
||||
test_when_finished "git config --local advice.statushints true" &&
|
||||
|
@ -698,7 +698,7 @@ test_expect_success 'status when rebase conflicts with statushints disabled' '
|
|||
test_commit three_statushints main.txt three &&
|
||||
test_when_finished "git rebase --abort" &&
|
||||
ONTO=$(git rev-parse --short HEAD^^) &&
|
||||
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
|
||||
test_must_fail git rebase --am HEAD^ --onto HEAD^^ &&
|
||||
cat >expected <<EOF &&
|
||||
rebase in progress; onto $ONTO
|
||||
You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
|
||||
|
|
Loading…
Reference in a new issue