Merge branch 'jc/capability-leak'

Leakfix.

* jc/capability-leak:
  connect: plug protocol capability leak
This commit is contained in:
Junio C Hamano
2025-12-17 14:11:52 +09:00
3 changed files with 42 additions and 0 deletions

View File

@@ -240,6 +240,8 @@ static void process_capabilities(struct packet_reader *reader, size_t *linelen)
size_t nul_location = strlen(line);
if (nul_location == *linelen)
return;
free(server_capabilities_v1);
server_capabilities_v1 = xstrdup(line + nul_location + 1);
*linelen = nul_location;

View File

@@ -690,6 +690,7 @@ integration_tests = [
't5562-http-backend-content-length.sh',
't5563-simple-http-auth.sh',
't5564-http-proxy.sh',
't5565-push-multiple.sh',
't5570-git-daemon.sh',
't5571-pre-push-hook.sh',
't5572-pull-submodule.sh',

39
t/t5565-push-multiple.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
test_description='push to group'
. ./test-lib.sh
test_expect_success setup '
for i in 1 2 3
do
git init dest-$i &&
git -C dest-$i symbolic-ref HEAD refs/heads/not-a-branch ||
return 1
done &&
test_tick &&
git commit --allow-empty -m "initial" &&
git config set --append remote.them.pushurl "file://$(pwd)/dest-1" &&
git config set --append remote.them.pushurl "file://$(pwd)/dest-2" &&
git config set --append remote.them.pushurl "file://$(pwd)/dest-3" &&
git config set --append remote.them.push "+refs/heads/*:refs/heads/*"
'
test_expect_success 'push to group' '
git push them &&
j= &&
for i in 1 2 3
do
git -C dest-$i for-each-ref >actual-$i &&
if test -n "$j"
then
test_cmp actual-$j actual-$i
else
cat actual-$i
fi &&
j=$i ||
return 1
done
'
test_done