{"thread":{"id":"52430","subject":"[PATCH] refs: pass NULL to refs_read_ref_full() because object ID is not needed","startedAt":"2019-12-11T18:46:25Z","lastAt":"2019-12-11T19:01:52Z","messageCount":2,"participants":["René Scharfe","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"387961","messageId":"a762958e-324b-f9a5-96e4-fab0b4b91df8@web.de","threadId":"52430","inReplyTo":null,"subject":"[PATCH] refs: pass NULL to refs_read_ref_full() because object ID is not needed","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-12-11T18:46:19Z","receivedAt":"2019-12-11T18:46:25Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"refs_read_ref_full() wraps refs_resolve_ref_unsafe(), which handles a\nNULL oid pointer of callers not interested in the resolved object ID.\nPass NULL from files_copy_or_rename_ref() to clarify that it is one\nsuch caller.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n refs/files-backend.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex d60767ab73..0ea66a28b6 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -1327,7 +1327,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,\n {\n \tstruct files_ref_store *refs =\n \t\tfiles_downcast(ref_store, REF_STORE_WRITE, \"rename_ref\");\n-\tstruct object_id oid, orig_oid;\n+\tstruct object_id orig_oid;\n \tint flag = 0, logmoved = 0;\n \tstruct ref_lock *lock;\n \tstruct stat loginfo;\n@@ -1395,7 +1395,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,\n \t */\n \tif (!copy && !refs_read_ref_full(&refs->base, newrefname,\n \t\t\t\tRESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,\n-\t\t\t\t&oid, NULL) &&\n+\t\t\t\tNULL, NULL) &&\n \t    refs_delete_ref(&refs->base, NULL, newrefname,\n \t\t\t    NULL, REF_NO_DEREF)) {\n \t\tif (errno == EISDIR) {\n--\n2.24.1\n"},{"id":"387966","messageId":"3f39d0f8-adfb-5f25-a724-f37f26904fa6@gmail.com","threadId":"52430","inReplyTo":"a762958e-324b-f9a5-96e4-fab0b4b91df8@web.de","subject":"Re: [PATCH] refs: pass NULL to refs_read_ref_full() because object ID is not needed","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-11T19:01:49Z","receivedAt":"2019-12-11T19:01:52Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/11/2019 1:46 PM, René Scharfe wrote:\n> refs_read_ref_full() wraps refs_resolve_ref_unsafe(), which handles a\n> NULL oid pointer of callers not interested in the resolved object ID.\n> Pass NULL from files_copy_or_rename_ref() to clarify that it is one\n> such caller.\n\nI suppose this could have been grouped/threaded with the other\nsimilar patch, but still correct. Thanks!\n\n-Stolee\n"}]}