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>

Felipe Contreras committed Nov 30, 2020 at 18:46 UTC bfded8757032ea7095ed688a1065c9767016e509
1 file changed +10 -9
refspec.c
+10 -9
@@ -272,15 +272,16 @@ void refspec_ref_prefixes(const struct refspec *rs,
272 else if (item->src && !item->exact_sha1)
273 prefix = item->src;
274
275 - if (prefix) {
276 - if (item->pattern) {
277 - const char *glob = strchr(prefix, '*');
278 - strvec_pushf(ref_prefixes, "%.*s",
279 - (int)(glob - prefix),
280 - prefix);
281 - } else {
282 - expand_ref_prefix(ref_prefixes, prefix);
283 - }
275 + if (!prefix)
276 + continue;
277 +
278 + if (item->pattern) {
279 + const char *glob = strchr(prefix, '*');
280 + strvec_pushf(ref_prefixes, "%.*s",
281 + (int)(glob - prefix),
282 + prefix);
283 + } else {
284 + expand_ref_prefix(ref_prefixes, prefix);
285 }
286 }
287 }