Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
fetch: trivial cleanup
author
Felipe Contreras
<felipe.contreras@gmail.com>
Tue, 4 Jun 2019 02:13:28 +0000
(21:13 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 4 Jun 2019 18:28:58 +0000
(11:28 -0700)
Create a helper function to clear an item. The way items are cleared has
changed, and will change again soon.
No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8144f09
)
diff --git
a/builtin/fetch.c
b/builtin/fetch.c
index aee1d9bf21cf7786ab4dad6590f914242a870a37..547b25d206c3acbd65fd042b0287ffc5568fa7d0 100644
(file)
--- a/
builtin/fetch.c
+++ b/
builtin/fetch.c
@@
-285,6
+285,11
@@
static int refname_hash_exists(struct hashmap *map, const char *refname)
return !!hashmap_get_from_hash(map, strhash(refname), refname);
}
return !!hashmap_get_from_hash(map, strhash(refname), refname);
}
+static void clear_item(struct refname_hash_entry *item)
+{
+ oidclr(&item->oid);
+}
+
static void find_non_local_tags(const struct ref *refs,
struct ref **head,
struct ref ***tail)
static void find_non_local_tags(const struct ref *refs,
struct ref **head,
struct ref ***tail)
@@
-318,7
+323,7
@@
static void find_non_local_tags(const struct ref *refs,
!has_sha1_file_with_flags(item->oid.hash,
OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
!has_sha1_file_with_flags(item->oid.hash,
OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
-
oidclr(&item->oid
);
+
clear_item(item
);
item = NULL;
continue;
}
item = NULL;
continue;
}
@@
-332,7
+337,7
@@
static void find_non_local_tags(const struct ref *refs,
if (item &&
!has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
if (item &&
!has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
-
oidclr(&item->oid
);
+
clear_item(item
);
item = NULL;
item = NULL;
@@
-353,7
+358,7
@@
static void find_non_local_tags(const struct ref *refs,
if (item &&
!has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
if (item &&
!has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->oid.hash))
-
oidclr(&item->oid
);
+
clear_item(item
);
/*
* For all the tags in the remote_refs_list,
/*
* For all the tags in the remote_refs_list,