diff options
author | Junio C Hamano <junkio@cox.net> | 2006-12-29 02:25:04 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-29 02:25:04 -0800 |
commit | 04509738b5779c33e59b93e4959b0ac19acab838 (patch) | |
tree | f0342e43374171164b99855218162609510cd0cf /t/t5400-send-pack.sh | |
parent | eff73751bb94b0241fd2204effb8680fe9973cbf (diff) | |
download | git-04509738b5779c33e59b93e4959b0ac19acab838.tar.gz |
t5400 send-pack test: try a bit more nontrivial transfer.
Not that this reveals anything new, but I did test_tick shell
function in test-lib and found it rather cute and nice.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t5400-send-pack.sh')
-rwxr-xr-x | t/t5400-send-pack.sh | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 28744b35e1..2c151912a3 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -8,38 +8,63 @@ test_description='See why rewinding head breaks send-pack ' . ./test-lib.sh -touch cpio-test -test_expect_success 'working cpio' 'echo cpio-test | cpio -o > /dev/null' - -cnt='1' +cnt=64 test_expect_success setup ' + test_tick && + mkdir mozart mozart/is && + echo "Commit #0" >mozart/is/pink && + git-update-index --add mozart/is/pink && tree=$(git-write-tree) && commit=$(echo "Commit #0" | git-commit-tree $tree) && zero=$commit && parent=$zero && - for i in $cnt + i=0 && + while test $i -le $cnt do - sleep 1 && + i=$(($i+1)) && + test_tick && + echo "Commit #$i" >mozart/is/pink && + git-update-index --add mozart/is/pink && + tree=$(git-write-tree) && commit=$(echo "Commit #$i" | git-commit-tree $tree -p $parent) && + git-update-ref refs/tags/commit$i $commit && parent=$commit || return 1 done && git-update-ref HEAD "$commit" && - git-clone -l ./. victim && + git-clone ./. victim && cd victim && git-log && cd .. && git-update-ref HEAD "$zero" && parent=$zero && - for i in $cnt + i=0 && + while test $i -le $cnt do - sleep 1 && + i=$(($i+1)) && + test_tick && + echo "Rebase #$i" >mozart/is/pink && + git-update-index --add mozart/is/pink && + tree=$(git-write-tree) && commit=$(echo "Rebase #$i" | git-commit-tree $tree -p $parent) && + git-update-ref refs/tags/rebase$i $commit && parent=$commit || return 1 done && git-update-ref HEAD "$commit" && echo Rebase && git-log' +test_expect_success 'pack the source repository' ' + git repack -a -d && + git prune +' + +test_expect_success 'pack the destination repository' ' + cd victim && + git repack -a -d && + git prune && + cd .. +' + test_expect_success \ 'pushing rewound head should not barf but require --force' ' # should not fail but refuse to update. |