diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-18 23:44:22 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-19 15:44:18 -0800 |
commit | 883b98efade212bf1496a93dd8a691355a31daf0 (patch) | |
tree | 5a9c67eb117e5840725328bbfae9714d3b8e5eb0 /t/t2022-checkout-paths.sh | |
parent | t[01]*: adjust the references to the default branch name "main" (diff) | |
download | tgif-883b98efade212bf1496a93dd8a691355a31daf0.tar.xz |
t2*: adjust the references to the default branch name "main"
Carefully excluding t2106, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests to the
default branch name `main`. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -- t2*.sh &&
git checkout HEAD -- t2106\*)
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/t2022-checkout-paths.sh')
-rwxr-xr-x | t/t2022-checkout-paths.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh index fc0f5b775c..c49ba7f9bd 100755 --- a/t/t2022-checkout-paths.sh +++ b/t/t2022-checkout-paths.sh @@ -1,22 +1,22 @@ #!/bin/sh test_description='checkout $tree -- $paths' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh test_expect_success setup ' mkdir dir && - >dir/master && + >dir/main && echo common >dir/common && - git add dir/master dir/common && - test_tick && git commit -m "master has dir/master" && + git add dir/main dir/common && + test_tick && git commit -m "main has dir/main" && git checkout -b next && - git mv dir/master dir/next0 && + git mv dir/main dir/next0 && echo next >dir/next1 && git add dir && - test_tick && git commit -m "next has dir/next but not dir/master" + test_tick && git commit -m "next has dir/next but not dir/main" ' test_expect_success 'checking out paths out of a tree does not clobber unrelated paths' ' @@ -29,11 +29,11 @@ test_expect_success 'checking out paths out of a tree does not clobber unrelated echo untracked >expect.next2 && cat expect.next2 >dir/next2 && - git checkout master dir && + git checkout main dir && test_cmp expect.common dir/common && - test_path_is_file dir/master && - git diff --exit-code master dir/master && + test_path_is_file dir/main && + git diff --exit-code main dir/main && test_path_is_missing dir/next0 && test_cmp expect.next1 dir/next1 && @@ -55,11 +55,11 @@ test_expect_success 'do not touch unmerged entries matching $path but not in $tr EOF git update-index --index-info <expect.next0 && - git checkout master dir && + git checkout main dir && test_cmp expect.common dir/common && - test_path_is_file dir/master && - git diff --exit-code master dir/master && + test_path_is_file dir/main && + git diff --exit-code main dir/main && git ls-files -s dir/next0 >actual.next0 && test_cmp expect.next0 actual.next0 ' |