Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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 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);
}
}
}