From: Felipe Contreras Date: Tue, 1 Dec 2020 00:46:46 +0000 (-0600) Subject: refspec: trivial cleanup X-Git-Tag: v2.30.0-rc0~13^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfded8757032ea7095ed688a1065c9767016e509;p=thirdparty%2Fgit.git refspec: trivial cleanup We can remove one level of indentation and make the code clearer. No functional changes. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- diff --git a/refspec.c b/refspec.c index c49347c2d7..d4823dbff9 100644 --- a/refspec.c +++ b/refspec.c @@ -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); } } }