diff options
Diffstat (limited to 't/t3432-rebase-fast-forward.sh')
-rwxr-xr-x | t/t3432-rebase-fast-forward.sh | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh index 6f0452c0ea..5086e14c02 100755 --- a/t/t3432-rebase-fast-forward.sh +++ b/t/t3432-rebase-fast-forward.sh @@ -5,6 +5,9 @@ test_description='ensure rebase fast-forwards commits when possible' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success setup ' @@ -60,15 +63,16 @@ test_rebase_same_head_ () { fi && oldhead=\$(git rev-parse HEAD) && test_when_finished 'git reset --hard \$oldhead' && - cp .git/logs/HEAD expect && + git reflog HEAD >expect && git rebase$flag $* >stdout && + git reflog HEAD >actual && if test $what = work then old=\$(wc -l <expect) && - test_line_count '-gt' \$old .git/logs/HEAD + test_line_count '-gt' \$old actual elif test $what = noop then - test_cmp expect .git/logs/HEAD + test_cmp expect actual fi && newhead=\$(git rev-parse HEAD) && if test $cmp = same @@ -83,19 +87,19 @@ test_rebase_same_head_ () { changes='no changes' test_rebase_same_head success noop same success work same -test_rebase_same_head success noop same success work same master +test_rebase_same_head success noop same success work same main test_rebase_same_head success noop same success work diff --onto B B test_rebase_same_head success noop same success work diff --onto B... B -test_rebase_same_head success noop same success work same --onto master... master -test_rebase_same_head success noop same success work same --keep-base master +test_rebase_same_head success noop same success work same --onto main... main +test_rebase_same_head success noop same success work same --keep-base main test_rebase_same_head success noop same success work same --keep-base test_rebase_same_head success noop same success work same --no-fork-point test_rebase_same_head success noop same success work same --keep-base --no-fork-point -test_rebase_same_head success noop same success work same --fork-point master +test_rebase_same_head success noop same success work same --fork-point main test_rebase_same_head success noop same success work diff --fork-point --onto B B test_rebase_same_head success noop same success work diff --fork-point --onto B... B -test_rebase_same_head success noop same success work same --fork-point --onto master... master -test_rebase_same_head success noop same success work same --keep-base --keep-base master +test_rebase_same_head success noop same success work same --fork-point --onto main... main +test_rebase_same_head success noop same success work same --keep-base --keep-base main test_expect_success 'add work same to side' ' test_commit E @@ -103,22 +107,22 @@ test_expect_success 'add work same to side' ' changes='our changes' test_rebase_same_head success noop same success work same -test_rebase_same_head success noop same success work same master +test_rebase_same_head success noop same success work same main test_rebase_same_head success noop same success work diff --onto B B test_rebase_same_head success noop same success work diff --onto B... B -test_rebase_same_head success noop same success work same --onto master... master -test_rebase_same_head success noop same success work same --keep-base master +test_rebase_same_head success noop same success work same --onto main... main +test_rebase_same_head success noop same success work same --keep-base main test_rebase_same_head success noop same success work same --keep-base test_rebase_same_head success noop same success work same --no-fork-point test_rebase_same_head success noop same success work same --keep-base --no-fork-point -test_rebase_same_head success noop same success work same --fork-point master +test_rebase_same_head success noop same success work same --fork-point main test_rebase_same_head success noop same success work diff --fork-point --onto B B test_rebase_same_head success noop same success work diff --fork-point --onto B... B -test_rebase_same_head success noop same success work same --fork-point --onto master... master -test_rebase_same_head success noop same success work same --fork-point --keep-base master +test_rebase_same_head success noop same success work same --fork-point --onto main... main +test_rebase_same_head success noop same success work same --fork-point --keep-base main test_expect_success 'add work same to upstream' ' - git checkout master && + git checkout main && test_commit F && git checkout side ' @@ -126,12 +130,12 @@ test_expect_success 'add work same to upstream' ' changes='our and their changes' test_rebase_same_head success noop same success work diff --onto B B test_rebase_same_head success noop same success work diff --onto B... B -test_rebase_same_head success noop same success work diff --onto master... master -test_rebase_same_head success noop same success work diff --keep-base master +test_rebase_same_head success noop same success work diff --onto main... main +test_rebase_same_head success noop same success work diff --keep-base main test_rebase_same_head success noop same success work diff --keep-base test_rebase_same_head failure work same success work diff --fork-point --onto B B test_rebase_same_head failure work same success work diff --fork-point --onto B... B -test_rebase_same_head success noop same success work diff --fork-point --onto master... master -test_rebase_same_head success noop same success work diff --fork-point --keep-base master +test_rebase_same_head success noop same success work diff --fork-point --onto main... main +test_rebase_same_head success noop same success work diff --fork-point --keep-base main test_done |