From 54fad6614fc6b61ee6eb4a5b3daa7a2239019b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 23 Sep 2017 11:41:45 +0200 Subject: refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional Allow callers of refs_resolve_ref_unsafe() to pass NULL if they don't need the resolved hash value. We already allow the same for the flags parameter. This new leniency is inherited by the various wrappers like resolve_ref_unsafe(). Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- refs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 78a26400b..996d4ea54 100644 --- a/refs.h +++ b/refs.h @@ -10,10 +10,11 @@ struct worktree; /* * Resolve a reference, recursively following symbolic refererences. * - * Store the referred-to object's name in sha1 and return the name of - * the non-symbolic reference that ultimately pointed at it. The - * return value, if not NULL, is a pointer into either a static buffer - * or the input ref. + * Return the name of the non-symbolic reference that ultimately pointed + * at the resolved object name. The return value, if not NULL, is a + * pointer into either a static buffer or the input ref. + * + * If sha1 is non-NULL, store the referred-to object's name in it. * * If the reference cannot be resolved to an object, the behavior * depends on the RESOLVE_REF_READING flag: -- cgit v1.2.1