summaryrefslogtreecommitdiff
path: root/refspec.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2020-12-01 00:46:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-12-01 18:31:29 (GMT)
commitbfded8757032ea7095ed688a1065c9767016e509 (patch)
treebf91585fd563095abb385210a9e4c732ff65bbf7 /refspec.c
parent72ffeb997eaf999f6938b2a7e0d9a75dcceaa311 (diff)
downloadgit-bfded8757032ea7095ed688a1065c9767016e509.zip
git-bfded8757032ea7095ed688a1065c9767016e509.tar.gz
git-bfded8757032ea7095ed688a1065c9767016e509.tar.bz2
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>
Diffstat (limited to 'refspec.c')
-rw-r--r--refspec.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/refspec.c b/refspec.c
index c49347c..d4823db 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);
}
}
}