Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-07 11:37:54 +0300
committerJunio C Hamano <gitster@pobox.com>2019-01-08 20:41:06 +0300
commit98374a07c98d1acc200c423b87495365a59cce0b (patch)
tree5d13cd44abc62bd17672bd00a7e8c28a198f5346 /builtin/fetch.c
parentd7a245730b4397e50592e1f4ebce765f7fbf5f93 (diff)
convert has_sha1_file() callers to has_object_file()
The only remaining callers of has_sha1_file() actually have an object_id already. They can use the "object" variant, rather than dereferencing the hash themselves. The code changes here were completely generated by the included coccinelle patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index e0140327aab..57f35c6a0af 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -317,8 +317,7 @@ static void find_non_local_tags(const struct ref *refs,
!has_object_file_with_flags(&ref->old_oid,
OBJECT_INFO_QUICK) &&
!will_fetch(head, ref->old_oid.hash) &&
- !has_sha1_file_with_flags(item->oid.hash,
- OBJECT_INFO_QUICK) &&
+ !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
oidclr(&item->oid);
item = NULL;
@@ -332,7 +331,7 @@ static void find_non_local_tags(const struct ref *refs,
* fetch.
*/
if (item &&
- !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
+ !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
oidclr(&item->oid);
@@ -353,7 +352,7 @@ static void find_non_local_tags(const struct ref *refs,
* checked to see if it needs fetching.
*/
if (item &&
- !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
+ !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
oidclr(&item->oid);