diff options
Diffstat (limited to 't/t5401-update-hooks.sh')
-rwxr-xr-x | t/t5401-update-hooks.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh index 956d69f5b1..6012cc8172 100755 --- a/t/t5401-update-hooks.sh +++ b/t/t5401-update-hooks.sh @@ -15,11 +15,11 @@ test_expect_success setup ' git update-index a && tree1=$(git write-tree) && commit1=$(echo modify | git commit-tree $tree1 -p $commit0) && - git update-ref refs/heads/master $commit0 && + git update-ref refs/heads/main $commit0 && git update-ref refs/heads/tofail $commit1 && git clone --bare ./. victim.git && GIT_DIR=victim.git git update-ref refs/heads/tofail $commit1 && - git update-ref refs/heads/master $commit1 && + git update-ref refs/heads/main $commit1 && git update-ref refs/heads/tofail $commit0 ' @@ -38,7 +38,7 @@ echo "$@" >>$GIT_DIR/update.args read x; printf %s "$x" >$GIT_DIR/update.stdin echo STDOUT update $1 echo STDERR update $1 >&2 -test "$1" = refs/heads/master || exit +test "$1" = refs/heads/main || exit EOF chmod u+x victim.git/hooks/update @@ -62,11 +62,11 @@ chmod u+x victim.git/hooks/post-update test_expect_success push ' test_must_fail git send-pack --force ./victim.git \ - master tofail >send.out 2>send.err + main tofail >send.out 2>send.err ' test_expect_success 'updated as expected' ' - test $(GIT_DIR=victim.git git rev-parse master) = $commit1 && + test $(GIT_DIR=victim.git git rev-parse main) = $commit1 && test $(GIT_DIR=victim.git git rev-parse tofail) = $commit1 ' @@ -82,24 +82,24 @@ test_expect_success 'hooks ran' ' ' test_expect_success 'pre-receive hook input' ' - (echo $commit0 $commit1 refs/heads/master && + (echo $commit0 $commit1 refs/heads/main && echo $commit1 $commit0 refs/heads/tofail ) | test_cmp - victim.git/pre-receive.stdin ' test_expect_success 'update hook arguments' ' - (echo refs/heads/master $commit0 $commit1 && + (echo refs/heads/main $commit0 $commit1 && echo refs/heads/tofail $commit1 $commit0 ) | test_cmp - victim.git/update.args ' test_expect_success 'post-receive hook input' ' - echo $commit0 $commit1 refs/heads/master | + echo $commit0 $commit1 refs/heads/main | test_cmp - victim.git/post-receive.stdin ' test_expect_success 'post-update hook arguments' ' - echo refs/heads/master | + echo refs/heads/main | test_cmp - victim.git/post-update.args ' @@ -120,8 +120,8 @@ test_expect_success 'send-pack produced no output' ' cat <<EOF >expect remote: STDOUT pre-receive remote: STDERR pre-receive -remote: STDOUT update refs/heads/master -remote: STDERR update refs/heads/master +remote: STDOUT update refs/heads/main +remote: STDERR update refs/heads/main remote: STDOUT update refs/heads/tofail remote: STDERR update refs/heads/tofail remote: error: hook declined to update refs/heads/tofail @@ -143,7 +143,7 @@ test_expect_success 'pre-receive hook that forgets to read its input' ' for v in $(test_seq 100 999) do - git branch branch_$v master || return + git branch branch_$v main || return done && git push ./victim.git "+refs/heads/*:refs/heads/*" ' |