summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Josh Steadmon <steadmon@google.com>2020-11-11 15:29:34 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-11 18:26:53 -0800
commita2a066d96aeaa13fe9124b84978d333243aa17c9 (patch)
tree1cbe76f7c20bf3d87fc4ea95ab9b003c5b77744c /t
parentsend-pack: advertise session ID in capabilities (diff)
downloadtgif-a2a066d96aeaa13fe9124b84978d333243aa17c9.tar.xz
receive-pack: log received client session ID
When receive-pack receives a session-id capability from the client, log the received session ID via a trace2 data event. Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5705-session-id-in-capabilities.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/t/t5705-session-id-in-capabilities.sh b/t/t5705-session-id-in-capabilities.sh
index afa2159657..f1d189d5bc 100755
--- a/t/t5705-session-id-in-capabilities.sh
+++ b/t/t5705-session-id-in-capabilities.sh
@@ -28,13 +28,17 @@ do
'
test_expect_success "session IDs not advertised by default (push v${PROTO})" '
- test_when_finished "rm -rf local tr2-client-events" &&
+ test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+ test_when_finished "git -C local push --delete origin new-branch" &&
cp -r "$LOCAL_PRISTINE" local &&
git -C local pull --no-rebase origin &&
GIT_TRACE2_EVENT_NESTING=5 \
GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
- git -c protocol.version=$PROTO -C local push origin &&
- test -z "$(grep \"key\":\"server-sid\" tr2-client-events)"
+ git -c protocol.version=$PROTO -C local push \
+ --receive-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-receive-pack" \
+ origin HEAD:new-branch &&
+ test -z "$(grep \"key\":\"server-sid\" tr2-client-events)" &&
+ test -z "$(grep \"key\":\"client-sid\" tr2-server-events)"
'
done
@@ -57,13 +61,17 @@ do
'
test_expect_success "session IDs advertised (push v${PROTO})" '
- test_when_finished "rm -rf local tr2-client-events" &&
+ test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+ test_when_finished "git -C local push --delete origin new-branch" &&
cp -r "$LOCAL_PRISTINE" local &&
git -C local pull --no-rebase origin &&
GIT_TRACE2_EVENT_NESTING=5 \
GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
- git -c protocol.version=$PROTO -C local push origin &&
- grep \"key\":\"server-sid\" tr2-client-events
+ git -c protocol.version=$PROTO -C local push \
+ --receive-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-receive-pack" \
+ origin HEAD:new-branch &&
+ grep \"key\":\"server-sid\" tr2-client-events &&
+ grep \"key\":\"client-sid\" tr2-server-events
'
done