summaryrefslogtreecommitdiff
path: root/fetch-object.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2018-09-12 15:47:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-13 20:57:31 (GMT)
commite68302011c902961bc55db5eec9b9e32acd114ca (patch)
tree37d917b19f085ac99f8ada98e6a6fa2f515742e7 /fetch-object.c
parent8708ca09a67aeccab1d6852382cfd9267a8a395e (diff)
downloadgit-e68302011c902961bc55db5eec9b9e32acd114ca.zip
git-e68302011c902961bc55db5eec9b9e32acd114ca.tar.gz
git-e68302011c902961bc55db5eec9b9e32acd114ca.tar.bz2
fetch-object: set exact_oid when fetching
fetch_objects() currently does not set exact_oid in struct ref when invoking transport_fetch_refs(). If the server supports ref-in-want, fetch_pack() uses this field to determine whether a wanted ref should be requested as a "want-ref" line or a "want" line; without the setting of exact_oid, the wrong line will be sent. Set exact_oid, so that the correct line is sent. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-object.c')
-rw-r--r--fetch-object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fetch-object.c b/fetch-object.c
index 1af1bf8..4266548 100644
--- a/fetch-object.c
+++ b/fetch-object.c
@@ -32,6 +32,7 @@ void fetch_objects(const char *remote_name, const struct object_id *oids,
for (i = 0; i < oid_nr; i++) {
struct ref *new_ref = alloc_ref(oid_to_hex(&oids[i]));
oidcpy(&new_ref->old_oid, &oids[i]);
+ new_ref->exact_oid = 1;
new_ref->next = ref;
ref = new_ref;
}