]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refspec: trivial cleanup
authorFelipe Contreras <felipe.contreras@gmail.com>
Tue, 1 Dec 2020 00:46:46 +0000 (18:46 -0600)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Dec 2020 18:31:29 +0000 (10:31 -0800)
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>
refspec.c

index c49347c2d7b78221324bdf76b5760eaab6ecf2ad..d4823dbff9be165ebfff562797a57c0d5019b5c0 100644 (file)
--- 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);
                }
        }
 }