@matheusbsbs / matheus-bagliano / commits / 99f86bde83
Fork 0

remote: pass NULL to read_ref_full() because object ID is not needed

read_ref_full() wraps refs_read_ref_full(), which in turn wraps refs_resolve_ref_unsafe(), which handles a NULL oid pointer of callers not interested in the resolved object ID. Make use of that feature to document that mv() is such a caller. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Dec 11, 2019 at 19:46 UTC 99f86bde8332dbff834b9e4c0e929c594200807a
1 file changed +1 -2
builtin/remote.c
+1 -2
@@ -693,9 +693,8 @@ static int mv(int argc, const char **argv)
693 for (i = 0; i < remote_branches.nr; i++) {
694 struct string_list_item *item = remote_branches.items + i;
695 int flag = 0;
696 - struct object_id oid;
696
698 - read_ref_full(item->string, RESOLVE_REF_READING, &oid, &flag);
697 + read_ref_full(item->string, RESOLVE_REF_READING, NULL, &flag);
698 if (!(flag & REF_ISSYMREF))
699 continue;
700 if (delete_ref(NULL, item->string, NULL, REF_NO_DEREF))