refs: pass NULL to resolve_ref_unsafe() if hash is not needed
This allows us to get rid of some write-only variables, among them seven SHA1 buffers. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e691b027b6
commit
744c040b19
@ -2263,11 +2263,10 @@ static int handle_revision_pseudo_opt(const char *submodule,
|
||||
|
||||
static void NORETURN diagnose_missing_default(const char *def)
|
||||
{
|
||||
unsigned char sha1[20];
|
||||
int flags;
|
||||
const char *refname;
|
||||
|
||||
refname = resolve_ref_unsafe(def, 0, sha1, &flags);
|
||||
refname = resolve_ref_unsafe(def, 0, NULL, &flags);
|
||||
if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))
|
||||
die(_("your current branch appears to be broken"));
|
||||
|
||||
|
Reference in New Issue
Block a user