From: Felipe Contreras Date: Tue, 01 Dec 2020 00:46:46 GMT Subject: [PATCH 1/4] refspec: trivial cleanup Message-ID: <20201201004649.57548-2-felipe.contreras@gmail.com> In-Reply-To: <20201201004649.57548-1-felipe.contreras@gmail.com> We can remove one level of indentation and make the code clearer. So why not do so? No functional changes. Signed-off-by: Felipe Contreras --- refspec.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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); } } } -- 2.29.2