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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2019-12-11 19:46:19 +01:00 committed by Junio C Hamano
parent ad05a3d8e5
commit e0ae2447d6

View File

@ -1327,7 +1327,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
{ {
struct files_ref_store *refs = struct files_ref_store *refs =
files_downcast(ref_store, REF_STORE_WRITE, "rename_ref"); files_downcast(ref_store, REF_STORE_WRITE, "rename_ref");
struct object_id oid, orig_oid; struct object_id orig_oid;
int flag = 0, logmoved = 0; int flag = 0, logmoved = 0;
struct ref_lock *lock; struct ref_lock *lock;
struct stat loginfo; struct stat loginfo;
@ -1395,7 +1395,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
*/ */
if (!copy && !refs_read_ref_full(&refs->base, newrefname, if (!copy && !refs_read_ref_full(&refs->base, newrefname,
RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE, RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
&oid, NULL) && NULL, NULL) &&
refs_delete_ref(&refs->base, NULL, newrefname, refs_delete_ref(&refs->base, NULL, newrefname,
NULL, REF_NO_DEREF)) { NULL, REF_NO_DEREF)) {
if (errno == EISDIR) { if (errno == EISDIR) {