t5400,t5402: consistently indent with tabs, not with spaces
This patch actually prepares for the upcoming patches to replace `master` with `main` in these tests: we do not want those changes to be flagged by the new `check-whitespace` GitHub workflow (even if those changes do not introduce the whitespace issues, they touch lines affected by those issues without fixing them). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
adbcf53e3f
commit
739edb2a73
@ -21,14 +21,15 @@ test_expect_success setup '
|
|||||||
i=0 &&
|
i=0 &&
|
||||||
while test $i -le $cnt
|
while test $i -le $cnt
|
||||||
do
|
do
|
||||||
i=$(($i+1)) &&
|
i=$(($i+1)) &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
echo "Commit #$i" >mozart/is/pink &&
|
echo "Commit #$i" >mozart/is/pink &&
|
||||||
git update-index --add mozart/is/pink &&
|
git update-index --add mozart/is/pink &&
|
||||||
tree=$(git write-tree) &&
|
tree=$(git write-tree) &&
|
||||||
commit=$(echo "Commit #$i" | git commit-tree $tree -p $parent) &&
|
commit=$(echo "Commit #$i" |
|
||||||
git update-ref refs/tags/commit$i $commit &&
|
git commit-tree $tree -p $parent) &&
|
||||||
parent=$commit || return 1
|
git update-ref refs/tags/commit$i $commit &&
|
||||||
|
parent=$commit || return 1
|
||||||
done &&
|
done &&
|
||||||
git update-ref HEAD "$commit" &&
|
git update-ref HEAD "$commit" &&
|
||||||
git clone ./. victim &&
|
git clone ./. victim &&
|
||||||
@ -38,14 +39,14 @@ test_expect_success setup '
|
|||||||
i=0 &&
|
i=0 &&
|
||||||
while test $i -le $cnt
|
while test $i -le $cnt
|
||||||
do
|
do
|
||||||
i=$(($i+1)) &&
|
i=$(($i+1)) &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
echo "Rebase #$i" >mozart/is/pink &&
|
echo "Rebase #$i" >mozart/is/pink &&
|
||||||
git update-index --add mozart/is/pink &&
|
git update-index --add mozart/is/pink &&
|
||||||
tree=$(git write-tree) &&
|
tree=$(git write-tree) &&
|
||||||
commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
|
commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
|
||||||
git update-ref refs/tags/rebase$i $commit &&
|
git update-ref refs/tags/rebase$i $commit &&
|
||||||
parent=$commit || return 1
|
parent=$commit || return 1
|
||||||
done &&
|
done &&
|
||||||
git update-ref HEAD "$commit" &&
|
git update-ref HEAD "$commit" &&
|
||||||
echo Rebase &&
|
echo Rebase &&
|
||||||
@ -57,11 +58,11 @@ test_expect_success 'pack the source repository' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'pack the destination repository' '
|
test_expect_success 'pack the destination repository' '
|
||||||
(
|
(
|
||||||
cd victim &&
|
cd victim &&
|
||||||
git repack -a -d &&
|
git repack -a -d &&
|
||||||
git prune
|
git prune
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'refuse pushing rewound head without --force' '
|
test_expect_success 'refuse pushing rewound head without --force' '
|
||||||
@ -85,10 +86,10 @@ test_expect_success 'push can be used to delete a ref' '
|
|||||||
|
|
||||||
test_expect_success 'refuse deleting push with denyDeletes' '
|
test_expect_success 'refuse deleting push with denyDeletes' '
|
||||||
(
|
(
|
||||||
cd victim &&
|
cd victim &&
|
||||||
test_might_fail git branch -D extra &&
|
test_might_fail git branch -D extra &&
|
||||||
git config receive.denyDeletes true &&
|
git config receive.denyDeletes true &&
|
||||||
git branch extra master
|
git branch extra master
|
||||||
) &&
|
) &&
|
||||||
test_must_fail git send-pack ./victim :extra master
|
test_must_fail git send-pack ./victim :extra master
|
||||||
'
|
'
|
||||||
@ -118,9 +119,9 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
|
|||||||
|
|
||||||
test_expect_success 'denyNonFastforwards trumps --force' '
|
test_expect_success 'denyNonFastforwards trumps --force' '
|
||||||
(
|
(
|
||||||
cd victim &&
|
cd victim &&
|
||||||
test_might_fail git branch -D extra &&
|
test_might_fail git branch -D extra &&
|
||||||
git config receive.denyNonFastforwards true
|
git config receive.denyNonFastforwards true
|
||||||
) &&
|
) &&
|
||||||
victim_orig=$(cd victim && git rev-parse --verify master) &&
|
victim_orig=$(cd victim && git rev-parse --verify master) &&
|
||||||
test_must_fail git send-pack --force ./victim master^:master &&
|
test_must_fail git send-pack --force ./victim master^:master &&
|
||||||
@ -143,16 +144,16 @@ test_expect_success 'send-pack --all sends all branches' '
|
|||||||
test_expect_success 'push --all excludes remote-tracking hierarchy' '
|
test_expect_success 'push --all excludes remote-tracking hierarchy' '
|
||||||
mkdir parent &&
|
mkdir parent &&
|
||||||
(
|
(
|
||||||
cd parent &&
|
cd parent &&
|
||||||
git init && : >file && git add file && git commit -m add
|
git init && : >file && git add file && git commit -m add
|
||||||
) &&
|
) &&
|
||||||
git clone parent child &&
|
git clone parent child &&
|
||||||
(
|
(
|
||||||
cd child && git push --all
|
cd child && git push --all
|
||||||
) &&
|
) &&
|
||||||
(
|
(
|
||||||
cd parent &&
|
cd parent &&
|
||||||
test -z "$(git for-each-ref refs/remotes/origin)"
|
test -z "$(git for-each-ref refs/remotes/origin)"
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -160,33 +161,33 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
|
|||||||
rm -rf parent child &&
|
rm -rf parent child &&
|
||||||
git init parent &&
|
git init parent &&
|
||||||
(
|
(
|
||||||
# Setup a repo with 2 packs
|
# Setup a repo with 2 packs
|
||||||
cd parent &&
|
cd parent &&
|
||||||
echo "Some text" >file.txt &&
|
echo "Some text" >file.txt &&
|
||||||
git add . &&
|
git add . &&
|
||||||
git commit -m "Initial commit" &&
|
git commit -m "Initial commit" &&
|
||||||
git repack -adl &&
|
git repack -adl &&
|
||||||
echo "Some more text" >>file.txt &&
|
echo "Some more text" >>file.txt &&
|
||||||
git commit -a -m "Second commit" &&
|
git commit -a -m "Second commit" &&
|
||||||
git repack
|
git repack
|
||||||
) &&
|
) &&
|
||||||
cp -R parent child &&
|
cp -R parent child &&
|
||||||
(
|
(
|
||||||
# Set the child to auto-pack if more than one pack exists
|
# Set the child to auto-pack if more than one pack exists
|
||||||
cd child &&
|
cd child &&
|
||||||
git config gc.autopacklimit 1 &&
|
git config gc.autopacklimit 1 &&
|
||||||
git config gc.autodetach false &&
|
git config gc.autodetach false &&
|
||||||
git branch test_auto_gc &&
|
git branch test_auto_gc &&
|
||||||
# And create a file that follows the temporary object naming
|
# And create a file that follows the temporary object naming
|
||||||
# convention for the auto-gc to remove
|
# convention for the auto-gc to remove
|
||||||
: >.git/objects/tmp_test_object &&
|
: >.git/objects/tmp_test_object &&
|
||||||
test-tool chmtime =-1209601 .git/objects/tmp_test_object
|
test-tool chmtime =-1209601 .git/objects/tmp_test_object
|
||||||
) &&
|
) &&
|
||||||
(
|
(
|
||||||
cd parent &&
|
cd parent &&
|
||||||
echo "Even more text" >>file.txt &&
|
echo "Even more text" >>file.txt &&
|
||||||
git commit -a -m "Third commit" &&
|
git commit -a -m "Third commit" &&
|
||||||
git send-pack ../child HEAD:refs/heads/test_auto_gc
|
git send-pack ../child HEAD:refs/heads/test_auto_gc
|
||||||
) &&
|
) &&
|
||||||
test ! -e child/.git/objects/tmp_test_object
|
test ! -e child/.git/objects/tmp_test_object
|
||||||
'
|
'
|
||||||
@ -195,15 +196,15 @@ rewound_push_setup() {
|
|||||||
rm -rf parent child &&
|
rm -rf parent child &&
|
||||||
mkdir parent &&
|
mkdir parent &&
|
||||||
(
|
(
|
||||||
cd parent &&
|
cd parent &&
|
||||||
git init &&
|
git init &&
|
||||||
echo one >file && git add file && git commit -m one &&
|
echo one >file && git add file && git commit -m one &&
|
||||||
git config receive.denyCurrentBranch warn &&
|
git config receive.denyCurrentBranch warn &&
|
||||||
echo two >file && git commit -a -m two
|
echo two >file && git commit -a -m two
|
||||||
) &&
|
) &&
|
||||||
git clone parent child &&
|
git clone parent child &&
|
||||||
(
|
(
|
||||||
cd child && git reset --hard HEAD^
|
cd child && git reset --hard HEAD^
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,16 +212,16 @@ test_expect_success 'pushing explicit refspecs respects forcing' '
|
|||||||
rewound_push_setup &&
|
rewound_push_setup &&
|
||||||
parent_orig=$(cd parent && git rev-parse --verify master) &&
|
parent_orig=$(cd parent && git rev-parse --verify master) &&
|
||||||
(
|
(
|
||||||
cd child &&
|
cd child &&
|
||||||
test_must_fail git send-pack ../parent \
|
test_must_fail git send-pack ../parent \
|
||||||
refs/heads/master:refs/heads/master
|
refs/heads/master:refs/heads/master
|
||||||
) &&
|
) &&
|
||||||
parent_head=$(cd parent && git rev-parse --verify master) &&
|
parent_head=$(cd parent && git rev-parse --verify master) &&
|
||||||
test "$parent_orig" = "$parent_head" &&
|
test "$parent_orig" = "$parent_head" &&
|
||||||
(
|
(
|
||||||
cd child &&
|
cd child &&
|
||||||
git send-pack ../parent \
|
git send-pack ../parent \
|
||||||
+refs/heads/master:refs/heads/master
|
+refs/heads/master:refs/heads/master
|
||||||
) &&
|
) &&
|
||||||
parent_head=$(cd parent && git rev-parse --verify master) &&
|
parent_head=$(cd parent && git rev-parse --verify master) &&
|
||||||
child_head=$(cd child && git rev-parse --verify master) &&
|
child_head=$(cd child && git rev-parse --verify master) &&
|
||||||
@ -231,16 +232,16 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
|
|||||||
rewound_push_setup &&
|
rewound_push_setup &&
|
||||||
parent_orig=$(cd parent && git rev-parse --verify master) &&
|
parent_orig=$(cd parent && git rev-parse --verify master) &&
|
||||||
(
|
(
|
||||||
cd child &&
|
cd child &&
|
||||||
test_must_fail git send-pack ../parent \
|
test_must_fail git send-pack ../parent \
|
||||||
"refs/heads/*:refs/heads/*"
|
"refs/heads/*:refs/heads/*"
|
||||||
) &&
|
) &&
|
||||||
parent_head=$(cd parent && git rev-parse --verify master) &&
|
parent_head=$(cd parent && git rev-parse --verify master) &&
|
||||||
test "$parent_orig" = "$parent_head" &&
|
test "$parent_orig" = "$parent_head" &&
|
||||||
(
|
(
|
||||||
cd child &&
|
cd child &&
|
||||||
git send-pack ../parent \
|
git send-pack ../parent \
|
||||||
"+refs/heads/*:refs/heads/*"
|
"+refs/heads/*:refs/heads/*"
|
||||||
) &&
|
) &&
|
||||||
parent_head=$(cd parent && git rev-parse --verify master) &&
|
parent_head=$(cd parent && git rev-parse --verify master) &&
|
||||||
child_head=$(cd child && git rev-parse --verify master) &&
|
child_head=$(cd child && git rev-parse --verify master) &&
|
||||||
@ -250,8 +251,8 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
|
|||||||
test_expect_success 'deny pushing to delete current branch' '
|
test_expect_success 'deny pushing to delete current branch' '
|
||||||
rewound_push_setup &&
|
rewound_push_setup &&
|
||||||
(
|
(
|
||||||
cd child &&
|
cd child &&
|
||||||
test_must_fail git send-pack ../parent :refs/heads/master 2>errs
|
test_must_fail git send-pack ../parent :refs/heads/master 2>errs
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -289,7 +290,7 @@ test_expect_success 'receive-pack de-dupes .have lines' '
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION=0 \
|
GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION=0 \
|
||||||
git push \
|
git push \
|
||||||
--receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \
|
--receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \
|
||||||
fork HEAD:foo &&
|
fork HEAD:foo &&
|
||||||
extract_ref_advertisement <trace >refs &&
|
extract_ref_advertisement <trace >refs &&
|
||||||
|
@ -15,7 +15,7 @@ test_expect_success setup '
|
|||||||
git update-index a &&
|
git update-index a &&
|
||||||
tree1=$(git write-tree) &&
|
tree1=$(git write-tree) &&
|
||||||
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
|
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
|
||||||
git update-ref refs/heads/master $commit0 &&
|
git update-ref refs/heads/master $commit0 &&
|
||||||
git clone ./. clone1 &&
|
git clone ./. clone1 &&
|
||||||
GIT_DIR=clone1/.git git update-index --add a &&
|
GIT_DIR=clone1/.git git update-index --add a &&
|
||||||
git clone ./. clone2 &&
|
git clone ./. clone2 &&
|
||||||
@ -23,34 +23,34 @@ test_expect_success setup '
|
|||||||
'
|
'
|
||||||
|
|
||||||
for clone in 1 2; do
|
for clone in 1 2; do
|
||||||
cat >clone${clone}/.git/hooks/post-merge <<'EOF'
|
cat >clone${clone}/.git/hooks/post-merge <<'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo $@ >> $GIT_DIR/post-merge.args
|
echo $@ >> $GIT_DIR/post-merge.args
|
||||||
EOF
|
EOF
|
||||||
chmod u+x clone${clone}/.git/hooks/post-merge
|
chmod u+x clone${clone}/.git/hooks/post-merge
|
||||||
done
|
done
|
||||||
|
|
||||||
test_expect_success 'post-merge does not run for up-to-date ' '
|
test_expect_success 'post-merge does not run for up-to-date ' '
|
||||||
GIT_DIR=clone1/.git git merge $commit0 &&
|
GIT_DIR=clone1/.git git merge $commit0 &&
|
||||||
! test -f clone1/.git/post-merge.args
|
! test -f clone1/.git/post-merge.args
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'post-merge runs as expected ' '
|
test_expect_success 'post-merge runs as expected ' '
|
||||||
GIT_DIR=clone1/.git git merge $commit1 &&
|
GIT_DIR=clone1/.git git merge $commit1 &&
|
||||||
test -e clone1/.git/post-merge.args
|
test -e clone1/.git/post-merge.args
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'post-merge from normal merge receives the right argument ' '
|
test_expect_success 'post-merge from normal merge receives the right argument ' '
|
||||||
grep 0 clone1/.git/post-merge.args
|
grep 0 clone1/.git/post-merge.args
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'post-merge from squash merge runs as expected ' '
|
test_expect_success 'post-merge from squash merge runs as expected ' '
|
||||||
GIT_DIR=clone2/.git git merge --squash $commit1 &&
|
GIT_DIR=clone2/.git git merge --squash $commit1 &&
|
||||||
test -e clone2/.git/post-merge.args
|
test -e clone2/.git/post-merge.args
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'post-merge from squash merge receives the right argument ' '
|
test_expect_success 'post-merge from squash merge receives the right argument ' '
|
||||||
grep 1 clone2/.git/post-merge.args
|
grep 1 clone2/.git/post-merge.args
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Reference in New Issue
Block a user