diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-02 15:07:19 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-02 15:07:19 -0800 |
commit | 444cff61b4467f71805b0def8300ab4e9c285bb4 (patch) | |
tree | 5a0661ee30274e041776b80fae5a4531de65b275 /builtin/fetch.c | |
parent | Merge branch 'en/t3433-rebase-stat-dirty-failure' (diff) | |
parent | partial-clone: avoid fetching when looking for objects (diff) | |
download | tgif-444cff61b4467f71805b0def8300ab4e9c285bb4.tar.xz |
Merge branch 'ds/partial-clone-fixes'
Fix for a bug revealed by a recent change to make the protocol v2
the default.
* ds/partial-clone-fixes:
partial-clone: avoid fetching when looking for objects
partial-clone: demonstrate bugs in partial fetch
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r-- | builtin/fetch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index ab7e4b1f3e..bf6bab80fa 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -335,6 +335,7 @@ static void find_non_local_tags(const struct ref *refs, struct string_list_item *remote_ref_item; const struct ref *ref; struct refname_hash_entry *item = NULL; + const int quick_flags = OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT; refname_hash_init(&existing_refs); refname_hash_init(&remote_refs); @@ -353,10 +354,9 @@ static void find_non_local_tags(const struct ref *refs, */ if (ends_with(ref->name, "^{}")) { if (item && - !has_object_file_with_flags(&ref->old_oid, - OBJECT_INFO_QUICK) && + !has_object_file_with_flags(&ref->old_oid, quick_flags) && !oidset_contains(&fetch_oids, &ref->old_oid) && - !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) && + !has_object_file_with_flags(&item->oid, quick_flags) && !oidset_contains(&fetch_oids, &item->oid)) clear_item(item); item = NULL; @@ -370,7 +370,7 @@ static void find_non_local_tags(const struct ref *refs, * fetch. */ if (item && - !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) && + !has_object_file_with_flags(&item->oid, quick_flags) && !oidset_contains(&fetch_oids, &item->oid)) clear_item(item); @@ -391,7 +391,7 @@ static void find_non_local_tags(const struct ref *refs, * checked to see if it needs fetching. */ if (item && - !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) && + !has_object_file_with_flags(&item->oid, quick_flags) && !oidset_contains(&fetch_oids, &item->oid)) clear_item(item); |