summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-06-27 22:30:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-28 16:33:30 (GMT)
commit733020517a1baa6f4f76bb7bf48d8d8d14eecd6c (patch)
treecb4e089898020b2b65f045529284f3756f303842 /remote.c
parent989b8c4452f63f415c276df348defce6df613696 (diff)
downloadgit-733020517a1baa6f4f76bb7bf48d8d8d14eecd6c.zip
git-733020517a1baa6f4f76bb7bf48d8d8d14eecd6c.tar.gz
git-733020517a1baa6f4f76bb7bf48d8d8d14eecd6c.tar.bz2
fetch-pack: implement ref-in-want
Implement ref-in-want on the client side so that when a server supports the "ref-in-want" feature, a client will send "want-ref" lines for each reference the client wants to fetch. This feature allows clients to tolerate inconsistencies that exist when a remote repository's refs change during the course of negotiation. This allows a client to request to request a particular ref without specifying the OID of the ref. This means that instead of hitting an error when a ref no longer points at the OID it did at the beginning of negotiation, negotiation can continue and the value of that ref will be sent at the termination of negotiation, just before a packfile is sent. More information on the ref-in-want feature can be found in Documentation/technical/protocol-v2.txt. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index abe80c1..2c2376f 100644
--- a/remote.c
+++ b/remote.c
@@ -1735,6 +1735,7 @@ int get_fetch_map(const struct ref *remote_refs,
if (refspec->exact_sha1) {
ref_map = alloc_ref(name);
get_oid_hex(name, &ref_map->old_oid);
+ ref_map->exact_oid = 1;
} else {
ref_map = get_remote_ref(remote_refs, name);
}