refspec: trivial cleanup

We can remove one level of indentation and make the code clearer.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Felipe Contreras 2020-11-30 18:46:46 -06:00 committed by Junio C Hamano
parent 72ffeb997e
commit bfded87570
1 changed files with 10 additions and 9 deletions

View File

@ -272,7 +272,9 @@ void refspec_ref_prefixes(const struct refspec *rs,
else if (item->src && !item->exact_sha1) else if (item->src && !item->exact_sha1)
prefix = item->src; prefix = item->src;


if (prefix) { if (!prefix)
continue;

if (item->pattern) { if (item->pattern) {
const char *glob = strchr(prefix, '*'); const char *glob = strchr(prefix, '*');
strvec_pushf(ref_prefixes, "%.*s", strvec_pushf(ref_prefixes, "%.*s",
@ -283,4 +285,3 @@ void refspec_ref_prefixes(const struct refspec *rs,
} }
} }
} }
}