Skip to content

Commit 99f86bd

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e0ae244 commit 99f86bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/remote.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,8 @@ static int mv(int argc, const char **argv)
693693
for (i = 0; i < remote_branches.nr; i++) {
694694
struct string_list_item *item = remote_branches.items + i;
695695
int flag = 0;
696-
struct object_id oid;
697696

698-
read_ref_full(item->string, RESOLVE_REF_READING, &oid, &flag);
697+
read_ref_full(item->string, RESOLVE_REF_READING, NULL, &flag);
699698
if (!(flag & REF_ISSYMREF))
700699
continue;
701700
if (delete_ref(NULL, item->string, NULL, REF_NO_DEREF))

0 commit comments

Comments
 (0)