fetch: trivial cleanup

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>

Felipe Contreras committed Jun 3, 2019 at 21:13 UTC a8363b57193ea3e881367ff06035d4a2fe021d59
1 file changed +8 -3
builtin/fetch.c
+8 -3
@@ -285,6 +285,11 @@ static int refname_hash_exists(struct hashmap *map, const char *refname)
285 return !!hashmap_get_from_hash(map, strhash(refname), refname);
286 }
287
288 +static void clear_item(struct refname_hash_entry *item)
289 +{
290 + oidclr(&item->oid);
291 +}
292 +
293 static void find_non_local_tags(const struct ref *refs,
294 struct ref **head,
295 struct ref ***tail)
@@ -318,7 +323,7 @@ static void find_non_local_tags(const struct ref *refs,
323 !has_sha1_file_with_flags(item->oid.hash,
324 OBJECT_INFO_QUICK) &&
325 !will_fetch(head, item->oid.hash))
321 - oidclr(&item->oid);
326 + clear_item(item);
327 item = NULL;
328 continue;
329 }
@@ -332,7 +337,7 @@ static void find_non_local_tags(const struct ref *refs,
337 if (item &&
338 !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
339 !will_fetch(head, item->oid.hash))
335 - oidclr(&item->oid);
340 + clear_item(item);
341
342 item = NULL;
343
@@ -353,7 +358,7 @@ static void find_non_local_tags(const struct ref *refs,
358 if (item &&
359 !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
360 !will_fetch(head, item->oid.hash))
356 - oidclr(&item->oid);
361 + clear_item(item);
362
363 /*
364 * For all the tags in the remote_refs_list,