diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-18 23:44:27 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-19 23:44:18 (GMT) |
commit | 8f37854b187a4539dd37752b2631849c94bd627b (patch) | |
tree | b57147cbdc2774ace04b7ea1f648900a6d59b08f /t/t4068-diff-symmetric-merge-base.sh | |
parent | cbc75a12f056c9e6eef30b92db2dc0ce99e97dbe (diff) | |
download | git-8f37854b187a4539dd37752b2631849c94bd627b.zip git-8f37854b187a4539dd37752b2631849c94bd627b.tar.gz git-8f37854b187a4539dd37752b2631849c94bd627b.tar.bz2 |
t4*: adjust the references to the default branch name "main"
Carefully excluding t4013 and t4015, which see independent development
elsewhere at the time of writing, we use `main` as the default branch
name in t4*. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -- t4*.sh t4211/*.export &&
git checkout HEAD -- t4013\*)
This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4068-diff-symmetric-merge-base.sh')
-rwxr-xr-x | t/t4068-diff-symmetric-merge-base.sh | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh index 55d4735..2d650d8 100755 --- a/t/t4068-diff-symmetric-merge-base.sh +++ b/t/t4068-diff-symmetric-merge-base.sh @@ -2,17 +2,17 @@ test_description='behavior of diff with symmetric-diff setups and --merge-base' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh # build these situations: # - normal merge with one merge base (br1...b2r); -# - criss-cross merge ie 2 merge bases (br1...master); -# - disjoint subgraph (orphan branch, br3...master). +# - criss-cross merge ie 2 merge bases (br1...main); +# - disjoint subgraph (orphan branch, br3...main). # -# B---E <-- master +# B---E <-- main # / \ / # A X # \ / \ @@ -35,9 +35,9 @@ test_expect_success setup ' git add c && git commit -m C && git tag commit-C && - git merge -m D master && + git merge -m D main && git tag commit-D && - git checkout master && + git checkout main && git merge -m E commit-C && git checkout -b br2 commit-C && echo f >f && @@ -61,7 +61,7 @@ test_expect_success 'diff with one merge base' ' # It should have one of those two, which comes out # to seven lines. test_expect_success 'diff with two merge bases' ' - git diff br1...master >tmp 2>err && + git diff br1...main >tmp 2>err && test_line_count = 7 tmp && test_line_count = 1 err ' @@ -72,22 +72,22 @@ test_expect_success 'diff with no merge bases' ' ' test_expect_success 'diff with too many symmetric differences' ' - test_must_fail git diff br1...master br2...br3 2>err && + test_must_fail git diff br1...main br2...br3 2>err && test_i18ngrep "usage" err ' test_expect_success 'diff with symmetric difference and extraneous arg' ' - test_must_fail git diff master br1...master 2>err && + test_must_fail git diff main br1...main 2>err && test_i18ngrep "usage" err ' test_expect_success 'diff with two ranges' ' - test_must_fail git diff master br1..master br2..br3 2>err && + test_must_fail git diff main br1..main br2..br3 2>err && test_i18ngrep "usage" err ' test_expect_success 'diff with ranges and extra arg' ' - test_must_fail git diff master br1..master commit-D 2>err && + test_must_fail git diff main br1..main commit-D 2>err && test_i18ngrep "usage" err ' @@ -96,21 +96,21 @@ test_expect_success 'diff --merge-base with no commits' ' ' test_expect_success 'diff --merge-base with three commits' ' - test_must_fail git diff --merge-base br1 br2 master 2>err && + test_must_fail git diff --merge-base br1 br2 main 2>err && test_i18ngrep "usage" err ' for cmd in diff-index diff do test_expect_success "$cmd --merge-base with one commit" ' - git checkout master && + git checkout main && git $cmd commit-C >expect && git $cmd --merge-base br2 >actual && test_cmp expect actual ' test_expect_success "$cmd --merge-base with one commit and unstaged changes" ' - git checkout master && + git checkout main && test_when_finished git reset --hard && echo unstaged >>c && git $cmd commit-C >expect && @@ -119,7 +119,7 @@ do ' test_expect_success "$cmd --merge-base with one commit and staged and unstaged changes" ' - git checkout master && + git checkout main && test_when_finished git reset --hard && echo staged >>c && git add c && @@ -130,7 +130,7 @@ do ' test_expect_success "$cmd --merge-base --cached with one commit and staged and unstaged changes" ' - git checkout master && + git checkout main && test_when_finished git reset --hard && echo staged >>c && git add c && @@ -141,19 +141,19 @@ do ' test_expect_success "$cmd --merge-base with non-commit" ' - git checkout master && - test_must_fail git $cmd --merge-base master^{tree} 2>err && + git checkout main && + test_must_fail git $cmd --merge-base main^{tree} 2>err && test_i18ngrep "fatal: --merge-base only works with commits" err ' test_expect_success "$cmd --merge-base with no merge bases and one commit" ' - git checkout master && + git checkout main && test_must_fail git $cmd --merge-base br3 2>err && test_i18ngrep "fatal: no merge base found" err ' test_expect_success "$cmd --merge-base with multiple merge bases and one commit" ' - git checkout master && + git checkout main && test_must_fail git $cmd --merge-base br1 2>err && test_i18ngrep "fatal: multiple merge bases found" err ' @@ -162,13 +162,13 @@ done for cmd in diff-tree diff do test_expect_success "$cmd --merge-base with two commits" ' - git $cmd commit-C master >expect && - git $cmd --merge-base br2 master >actual && + git $cmd commit-C main >expect && + git $cmd --merge-base br2 main >actual && test_cmp expect actual ' test_expect_success "$cmd --merge-base commit and non-commit" ' - test_must_fail git $cmd --merge-base br2 master^{tree} 2>err && + test_must_fail git $cmd --merge-base br2 main^{tree} 2>err && test_i18ngrep "fatal: --merge-base only works with commits" err ' @@ -178,13 +178,13 @@ do ' test_expect_success "$cmd --merge-base with multiple merge bases and two commits" ' - test_must_fail git $cmd --merge-base master br1 2>err && + test_must_fail git $cmd --merge-base main br1 2>err && test_i18ngrep "fatal: multiple merge bases found" err ' done test_expect_success 'diff-tree --merge-base with one commit' ' - test_must_fail git diff-tree --merge-base master 2>err && + test_must_fail git diff-tree --merge-base main 2>err && test_i18ngrep "fatal: --merge-base only works with two commits" err ' |