Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-19 02:44:40 +0300
committerJunio C Hamano <gitster@pobox.com>2020-11-20 02:44:18 +0300
commit1e2ae142c06f7648a646278947bbcb61173f37eb (patch)
treee1050696a0fb5f407ac538f1c944e78d420da791 /t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
parent01dc81336dc10c8f2350454c755a8a0ab676a9c9 (diff)
t7[5-9]*: adjust the references to the default branch name "main"
Excluding t7817, which is added in an unrelated patch series at the time of writing, this adjusts t7[5-9]*. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t7[5-9]*.sh) 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/t7503-pre-commit-and-pre-merge-commit-hooks.sh')
-rwxr-xr-xt/t7503-pre-commit-and-pre-merge-commit-hooks.sh44
1 files changed, 22 insertions, 22 deletions
diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
index 8d3f4ab0d7..606d8d0f08 100755
--- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
@@ -2,7 +2,7 @@
test_description='pre-commit and pre-merge-commit hooks'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
@@ -47,16 +47,16 @@ test_expect_success 'root commit' '
git add foo &&
git commit -m "make it non-ff" &&
git branch side-orig side &&
- git checkout master
+ git checkout main
'
test_expect_success 'setup conflicting branches' '
- test_when_finished "git checkout master" &&
- git checkout -b conflicting-a master &&
+ test_when_finished "git checkout main" &&
+ git checkout -b conflicting-a main &&
echo a >conflicting &&
git add conflicting &&
git commit -m conflicting-a &&
- git checkout -b conflicting-b master &&
+ git checkout -b conflicting-b main &&
echo b >conflicting &&
git add conflicting &&
git commit -m conflicting-b
@@ -74,8 +74,8 @@ test_expect_success 'with no hook (merge)' '
test_when_finished "rm -f actual_hooks" &&
git branch -f side side-orig &&
git checkout side &&
- git merge -m "merge master" master &&
- git checkout master &&
+ git merge -m "merge main" main &&
+ git checkout main &&
test_path_is_missing actual_hooks
'
@@ -91,8 +91,8 @@ test_expect_success '--no-verify with no hook (merge)' '
test_when_finished "rm -f actual_hooks" &&
git branch -f side side-orig &&
git checkout side &&
- git merge --no-verify -m "merge master" master &&
- git checkout master &&
+ git merge --no-verify -m "merge main" main &&
+ git checkout main &&
test_path_is_missing actual_hooks
'
@@ -111,15 +111,15 @@ test_expect_success 'with succeeding hook (merge)' '
cp "$HOOKDIR/success.sample" "$PREMERGE" &&
echo "$PREMERGE" >expected_hooks &&
git checkout side &&
- git merge -m "merge master" master &&
- git checkout master &&
+ git merge -m "merge main" main &&
+ git checkout main &&
test_cmp expected_hooks actual_hooks
'
test_expect_success 'automatic merge fails; both hooks are available' '
test_when_finished "rm -f \"$PREMERGE\" \"$PRECOMMIT\"" &&
test_when_finished "rm -f expected_hooks actual_hooks" &&
- test_when_finished "git checkout master" &&
+ test_when_finished "git checkout main" &&
cp "$HOOKDIR/success.sample" "$PREMERGE" &&
cp "$HOOKDIR/success.sample" "$PRECOMMIT" &&
@@ -148,8 +148,8 @@ test_expect_success '--no-verify with succeeding hook (merge)' '
cp "$HOOKDIR/success.sample" "$PREMERGE" &&
git branch -f side side-orig &&
git checkout side &&
- git merge --no-verify -m "merge master" master &&
- git checkout master &&
+ git merge --no-verify -m "merge main" main &&
+ git checkout main &&
test_path_is_missing actual_hooks
'
@@ -177,8 +177,8 @@ test_expect_success 'with failing hook (merge)' '
cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
echo "$PREMERGE" >expected_hooks &&
git checkout side &&
- test_must_fail git merge -m "merge master" master &&
- git checkout master &&
+ test_must_fail git merge -m "merge main" main &&
+ git checkout main &&
test_cmp expected_hooks actual_hooks
'
@@ -187,8 +187,8 @@ test_expect_success '--no-verify with failing hook (merge)' '
cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
git branch -f side side-orig &&
git checkout side &&
- git merge --no-verify -m "merge master" master &&
- git checkout master &&
+ git merge --no-verify -m "merge main" main &&
+ git checkout main &&
test_path_is_missing actual_hooks
'
@@ -215,8 +215,8 @@ test_expect_success POSIXPERM 'with non-executable hook (merge)' '
cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
git branch -f side side-orig &&
git checkout side &&
- git merge -m "merge master" master &&
- git checkout master &&
+ git merge -m "merge main" main &&
+ git checkout main &&
test_path_is_missing actual_hooks
'
@@ -225,8 +225,8 @@ test_expect_success POSIXPERM '--no-verify with non-executable hook (merge)' '
cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
git branch -f side side-orig &&
git checkout side &&
- git merge --no-verify -m "merge master" master &&
- git checkout master &&
+ git merge --no-verify -m "merge main" main &&
+ git checkout main &&
test_path_is_missing actual_hooks
'