diff options
| author | Felipe Contreras <felipe.contreras@gmail.com> | 2020-11-30 18:46:46 -0600 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-12-01 10:31:29 -0800 |
| commit | bfded8757032ea7095ed688a1065c9767016e509 (patch) | |
| tree | bf91585fd563095abb385210a9e4c732ff65bbf7 | |
| parent | 72ffeb997eaf999f6938b2a7e0d9a75dcceaa311 (diff) | |
| download | git-bfded8757032ea7095ed688a1065c9767016e509.tar.gz | |
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>
| -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); } } } |
