summaryrefslogtreecommitdiff
path: root/t/t5549-fetch-push-http.sh
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-07-15 17:44:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-15 18:58:52 (GMT)
commit54a03bc7d9a7f264d511d88166afe8da7f75e90a (patch)
treeb7482ea411f388965068f192886b94354d43aa64 /t/t5549-fetch-push-http.sh
parent74fab8ff54e6e6a30efa254b8b5322764d119386 (diff)
downloadgit-54a03bc7d9a7f264d511d88166afe8da7f75e90a.zip
git-54a03bc7d9a7f264d511d88166afe8da7f75e90a.tar.gz
git-54a03bc7d9a7f264d511d88166afe8da7f75e90a.tar.bz2
send-pack: fix push nego. when remote has refs
Commit 477673d6f3 ("send-pack: support push negotiation", 2021-05-05) did not test the case in which a remote advertises at least one ref. In such a case, "remote_refs" in get_commons_through_negotiation() in send-pack.c would also contain those refs with a zero ref->new_oid (in addition to the refs being pushed with a nonzero ref->new_oid). Passing them as negotiation tips to "git fetch" causes an error, so filter them out. (The exact error that would happen in "git fetch" in this case is a segmentation fault, which is unwanted. This will be fixed in the subsequent commit.) Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5549-fetch-push-http.sh')
-rwxr-xr-xt/t5549-fetch-push-http.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t5549-fetch-push-http.sh b/t/t5549-fetch-push-http.sh
index f50d584..2cdebcb 100755
--- a/t/t5549-fetch-push-http.sh
+++ b/t/t5549-fetch-push-http.sh
@@ -27,6 +27,7 @@ setup_client_and_server () {
git init "$SERVER" &&
test_when_finished 'rm -rf "$SERVER"' &&
test_config -C "$SERVER" http.receivepack true &&
+ test_commit -C "$SERVER" unrelated_commit &&
git -C client push "$URI" first_commit:refs/remotes/origin/first_commit &&
git -C "$SERVER" config receive.hideRefs refs/remotes/origin/first_commit
}