]> git.ipfire.org Git - thirdparty/git.git/commitdiff
remote: pass NULL to read_ref_full() because object ID is not needed
authorRené Scharfe <l.s.r@web.de>
Wed, 11 Dec 2019 18:46:37 +0000 (19:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Dec 2019 21:48:46 +0000 (13:48 -0800)
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>
builtin/remote.c

index 5591cef775432d2bd01b866183e789952ad36915..96bbe828fe20b138d3949ad7080621380c1fe00d 100644 (file)
@@ -693,9 +693,8 @@ static int mv(int argc, const char **argv)
        for (i = 0; i < remote_branches.nr; i++) {
                struct string_list_item *item = remote_branches.items + i;
                int flag = 0;
-               struct object_id oid;
 
-               read_ref_full(item->string, RESOLVE_REF_READING, &oid, &flag);
+               read_ref_full(item->string, RESOLVE_REF_READING, NULL, &flag);
                if (!(flag & REF_ISSYMREF))
                        continue;
                if (delete_ref(NULL, item->string, NULL, REF_NO_DEREF))