summaryrefslogtreecommitdiff
path: root/t/t5503-tagfollow.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-02-20 19:55:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-02-20 21:42:21 (GMT)
commit97a83fa839d818130bfeca060279c4c355036785 (patch)
tree9b6f16af4329b1be0fdb3c6d513bafac19dbee9c /t/t5503-tagfollow.sh
parente58e57e49eb990e38df19628a744c71b44397ef1 (diff)
downloadgit-97a83fa839d818130bfeca060279c4c355036785.zip
git-97a83fa839d818130bfeca060279c4c355036785.tar.gz
git-97a83fa839d818130bfeca060279c4c355036785.tar.bz2
upload-pack: remove packet debugging harness
If you set the GIT_DEBUG_SEND_PACK environment variable, upload-pack will dump lines it receives in the receive_needs phase to a descriptor. This debugging harness is a strict subset of what GIT_TRACE_PACKET can do. Let's just drop it in favor of that. A few tests used GIT_DEBUG_SEND_PACK to confirm which objects get sent; we have to adapt them to the new output format. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5503-tagfollow.sh')
-rwxr-xr-xt/t5503-tagfollow.sh38
1 files changed, 17 insertions, 21 deletions
diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 60de2d6..d181c96 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -5,7 +5,7 @@ test_description='test automatic tag following'
. ./test-lib.sh
if ! test_have_prereq NOT_MINGW; then
- say "GIT_DEBUG_SEND_PACK not supported - skipping tests"
+ say "GIT_TRACE_PACKET not supported - skipping tests"
fi
# End state of the repository:
@@ -42,21 +42,26 @@ U=UPLOAD_LOG
test_expect_success NOT_MINGW 'setup expect' '
cat - <<EOF >expect
-#S
want $A
-#E
EOF
'
+get_needs () {
+ perl -alne '
+ next unless $F[1] eq "upload-pack<";
+ last if $F[2] eq "0000";
+ print $F[2], " ", $F[3];
+ ' "$@"
+}
+
test_expect_success NOT_MINGW 'fetch A (new commit : 1 connection)' '
rm -f $U &&
(
cd cloned &&
- GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
+ GIT_TRACE_PACKET=3 git fetch 3>../$U &&
test $A = $(git rev-parse --verify origin/master)
) &&
- test -s $U &&
- cut -d" " -f1,2 $U >actual &&
+ get_needs $U >actual &&
test_cmp expect actual
'
@@ -74,10 +79,8 @@ test_expect_success NOT_MINGW "create tag T on A, create C on branch cat" '
test_expect_success NOT_MINGW 'setup expect' '
cat - <<EOF >expect
-#S
want $C
want $T
-#E
EOF
'
@@ -85,13 +88,12 @@ test_expect_success NOT_MINGW 'fetch C, T (new branch, tag : 1 connection)' '
rm -f $U &&
(
cd cloned &&
- GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
+ GIT_TRACE_PACKET=3 git fetch 3>../$U &&
test $C = $(git rev-parse --verify origin/cat) &&
test $T = $(git rev-parse --verify tag1) &&
test $A = $(git rev-parse --verify tag1^0)
) &&
- test -s $U &&
- cut -d" " -f1,2 $U >actual &&
+ get_needs $U >actual &&
test_cmp expect actual
'
@@ -113,10 +115,8 @@ test_expect_success NOT_MINGW "create commits O, B, tag S on B" '
test_expect_success NOT_MINGW 'setup expect' '
cat - <<EOF >expect
-#S
want $B
want $S
-#E
EOF
'
@@ -124,22 +124,19 @@ test_expect_success NOT_MINGW 'fetch B, S (commit and tag : 1 connection)' '
rm -f $U &&
(
cd cloned &&
- GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
+ GIT_TRACE_PACKET=3 git fetch 3>../$U &&
test $B = $(git rev-parse --verify origin/master) &&
test $B = $(git rev-parse --verify tag2^0) &&
test $S = $(git rev-parse --verify tag2)
) &&
- test -s $U &&
- cut -d" " -f1,2 $U >actual &&
+ get_needs $U >actual &&
test_cmp expect actual
'
test_expect_success NOT_MINGW 'setup expect' '
cat - <<EOF >expect
-#S
want $B
want $S
-#E
EOF
'
@@ -151,15 +148,14 @@ test_expect_success NOT_MINGW 'new clone fetch master and tags' '
cd clone2 &&
git init &&
git remote add origin .. &&
- GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
+ GIT_TRACE_PACKET=3 git fetch 3>../$U &&
test $B = $(git rev-parse --verify origin/master) &&
test $S = $(git rev-parse --verify tag2) &&
test $B = $(git rev-parse --verify tag2^0) &&
test $T = $(git rev-parse --verify tag1) &&
test $A = $(git rev-parse --verify tag1^0)
) &&
- test -s $U &&
- cut -d" " -f1,2 $U >actual &&
+ get_needs $U >actual &&
test_cmp expect actual
'