summaryrefslogtreecommitdiff
path: root/t/t4204-patch-id.sh
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2020-11-18 23:44:27 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-19 15:44:18 -0800
commit8f37854b187a4539dd37752b2631849c94bd627b (patch)
treeb57147cbdc2774ace04b7ea1f648900a6d59b08f /t/t4204-patch-id.sh
parentt3[5-9]*: adjust the references to the default branch name "main" (diff)
downloadtgif-8f37854b187a4539dd37752b2631849c94bd627b.tar.xz
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/t4204-patch-id.sh')
-rwxr-xr-xt/t4204-patch-id.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index 46ecb777f4..f120857c20 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -2,7 +2,7 @@
test_description='git patch-id'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
@@ -16,9 +16,9 @@ test_expect_success 'setup' '
test_write_lines $as b >foo &&
test_write_lines $as b >bar &&
git commit -a -m first &&
- git checkout -b same master &&
+ git checkout -b same main &&
git commit --amend -m same-msg &&
- git checkout -b notsame master &&
+ git checkout -b notsame main &&
echo c >foo &&
echo c >bar &&
git commit --amend -a -m notsame-msg &&
@@ -49,31 +49,31 @@ get_patch_id () {
}
test_expect_success 'patch-id detects equality' '
- get_patch_id master &&
+ get_patch_id main &&
get_patch_id same &&
- test_cmp patch-id_master patch-id_same
+ test_cmp patch-id_main patch-id_same
'
test_expect_success 'patch-id detects inequality' '
- get_patch_id master &&
+ get_patch_id main &&
get_patch_id notsame &&
- ! test_cmp patch-id_master patch-id_notsame
+ ! test_cmp patch-id_main patch-id_notsame
'
test_expect_success 'patch-id supports git-format-patch output' '
- get_patch_id master &&
+ get_patch_id main &&
git checkout same &&
git format-patch -1 --stdout | calc_patch_id same &&
- test_cmp patch-id_master patch-id_same &&
+ test_cmp patch-id_main patch-id_same &&
set $(git format-patch -1 --stdout | git patch-id) &&
test "$2" = $(git rev-parse HEAD)
'
test_expect_success 'whitespace is irrelevant in footer' '
- get_patch_id master &&
+ get_patch_id main &&
git checkout same &&
git format-patch -1 --stdout | sed "s/ \$//" | calc_patch_id same &&
- test_cmp patch-id_master patch-id_same
+ test_cmp patch-id_main patch-id_same
'
cmp_patch_id () {
@@ -91,7 +91,7 @@ test_patch_id_file_order () {
shift
name="order-${1}-$relevant"
shift
- get_top_diff "master" | calc_patch_id "$name" "$@" &&
+ get_top_diff "main" | calc_patch_id "$name" "$@" &&
git checkout same &&
git format-patch -1 --stdout -O foo-then-bar |
calc_patch_id "ordered-$name" "$@" &&
@@ -140,10 +140,10 @@ test_expect_success '--stable overrides patchid.stable = false' '
'
test_expect_success 'patch-id supports git-format-patch MIME output' '
- get_patch_id master &&
+ get_patch_id main &&
git checkout same &&
git format-patch -1 --attach --stdout | calc_patch_id same &&
- test_cmp patch-id_master patch-id_same
+ test_cmp patch-id_main patch-id_same
'
test_expect_success 'patch-id respects config from subdir' '