summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-26 20:14:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-26 20:14:47 (GMT)
commit9fcd14491d32d76c3533ba0b1dfe7cabf31fe852 (patch)
tree4411906265b2adcf0bac4d2b68bece4828ec6371 /builtin/fetch.c
parent92657ea597310c05b8f4ac3496ba90496286b5d6 (diff)
parent5827a03545663f6d6b491a35edb313900608568b (diff)
downloadgit-9fcd14491d32d76c3533ba0b1dfe7cabf31fe852.zip
git-9fcd14491d32d76c3533ba0b1dfe7cabf31fe852.tar.gz
git-9fcd14491d32d76c3533ba0b1dfe7cabf31fe852.tar.bz2
Merge branch 'jk/fetch-quick-tag-following'
When fetching from a remote that has many tags that are irrelevant to branches we are following, we used to waste way too many cycles when checking if the object pointed at by a tag (that we are not going to fetch!) exists in our repository too carefully. * jk/fetch-quick-tag-following: fetch: use "quick" has_sha1_file for tag following
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index d5329f9..74c0546 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -241,9 +241,10 @@ static void find_non_local_tags(struct transport *transport,
* as one to ignore by setting util to NULL.
*/
if (ends_with(ref->name, "^{}")) {
- if (item && !has_object_file(&ref->old_oid) &&
+ if (item &&
+ !has_object_file_with_flags(&ref->old_oid, HAS_SHA1_QUICK) &&
!will_fetch(head, ref->old_oid.hash) &&
- !has_sha1_file(item->util) &&
+ !has_sha1_file_with_flags(item->util, HAS_SHA1_QUICK) &&
!will_fetch(head, item->util))
item->util = NULL;
item = NULL;
@@ -256,7 +257,8 @@ static void find_non_local_tags(struct transport *transport,
* to check if it is a lightweight tag that we want to
* fetch.
*/
- if (item && !has_sha1_file(item->util) &&
+ if (item &&
+ !has_sha1_file_with_flags(item->util, HAS_SHA1_QUICK) &&
!will_fetch(head, item->util))
item->util = NULL;
@@ -276,7 +278,8 @@ static void find_non_local_tags(struct transport *transport,
* We may have a final lightweight tag that needs to be
* checked to see if it needs fetching.
*/
- if (item && !has_sha1_file(item->util) &&
+ if (item &&
+ !has_sha1_file_with_flags(item->util, HAS_SHA1_QUICK) &&
!will_fetch(head, item->util))
item->util = NULL;