aboutsummaryrefslogtreecommitdiffstats
path: root/refs
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-12-11 19:46:19 +0100
committerJunio C Hamano <gitster@pobox.com>2019-12-11 13:48:42 -0800
commite0ae2447d66aa3983837ddc3d6fc0c3371a8e350 (patch)
tree0331e72e5f0485836484da38360bb1e990fd8cb2 /refs
parentad05a3d8e5a6a06443836b5e40434262d992889a (diff)
downloadgit-e0ae2447d66aa3983837ddc3d6fc0c3371a8e350.tar.gz
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>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index d60767ab73..0ea66a28b6 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1327,7 +1327,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
{
struct files_ref_store *refs =
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;
struct ref_lock *lock;
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,
RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
- &oid, NULL) &&
+ NULL, NULL) &&
refs_delete_ref(&refs->base, NULL, newrefname,
NULL, REF_NO_DEREF)) {
if (errno == EISDIR) {