diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2020-12-01 03:46:46 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-01 21:31:29 +0300 |
commit | bfded8757032ea7095ed688a1065c9767016e509 (patch) | |
tree | bf91585fd563095abb385210a9e4c732ff65bbf7 /refspec.c | |
parent | 72ffeb997eaf999f6938b2a7e0d9a75dcceaa311 (diff) |
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>
Diffstat (limited to 'refspec.c')
-rw-r--r-- | refspec.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -272,15 +272,16 @@ void refspec_ref_prefixes(const struct refspec *rs, else if (item->src && !item->exact_sha1) prefix = item->src; - if (prefix) { - if (item->pattern) { - const char *glob = strchr(prefix, '*'); - strvec_pushf(ref_prefixes, "%.*s", - (int)(glob - prefix), - prefix); - } else { - expand_ref_prefix(ref_prefixes, prefix); - } + if (!prefix) + continue; + + if (item->pattern) { + const char *glob = strchr(prefix, '*'); + strvec_pushf(ref_prefixes, "%.*s", + (int)(glob - prefix), + prefix); + } else { + expand_ref_prefix(ref_prefixes, prefix); } } } |