Skip to content

Commit e0ae244

Browse files
rscharfegitster
authored andcommitted
refs: pass NULL to refs_read_ref_full() because object ID is not needed
refs_read_ref_full() wraps refs_resolve_ref_unsafe(), which handles a NULL oid pointer of callers not interested in the resolved object ID. Pass NULL from files_copy_or_rename_ref() to clarify that it is one such caller. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ad05a3d commit e0ae244

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

refs/files-backend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
13271327
{
13281328
struct files_ref_store *refs =
13291329
files_downcast(ref_store, REF_STORE_WRITE, "rename_ref");
1330-
struct object_id oid, orig_oid;
1330+
struct object_id orig_oid;
13311331
int flag = 0, logmoved = 0;
13321332
struct ref_lock *lock;
13331333
struct stat loginfo;
@@ -1395,7 +1395,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
13951395
*/
13961396
if (!copy && !refs_read_ref_full(&refs->base, newrefname,
13971397
RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
1398-
&oid, NULL) &&
1398+
NULL, NULL) &&
13991399
refs_delete_ref(&refs->base, NULL, newrefname,
14001400
NULL, REF_NO_DEREF)) {
14011401
if (errno == EISDIR) {

0 commit comments

Comments
 (0)