From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH 1/4] refspec: trivial cleanup
Date: Mon, 30 Nov 2020 18:46:46 -0600 [thread overview]
Message-ID: <20201201004649.57548-2-felipe.contreras@gmail.com> (raw)
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 <felipe.contreras@gmail.com>
---
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
next prev parent reply other threads:[~2020-12-01 0:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 0:46 [PATCH 0/4] Random cleanups Felipe Contreras
2020-12-01 0:46 ` Felipe Contreras [this message]
2020-12-01 11:43 ` [PATCH 1/4] refspec: trivial cleanup Jeff King
2020-12-01 18:29 ` Junio C Hamano
2020-12-01 23:25 ` Felipe Contreras
2020-12-02 2:01 ` Jeff King
2020-12-02 2:27 ` Felipe Contreras
2020-12-01 0:46 ` [PATCH 2/4] .gitignore: remove dangling file Felipe Contreras
2020-12-01 18:30 ` Junio C Hamano
2020-12-01 23:32 ` Felipe Contreras
2020-12-02 2:26 ` Jeff King
2020-12-02 3:30 ` Felipe Contreras
2020-12-02 11:46 ` [PATCH] gitignore: remove entry for git serve René Scharfe
2020-12-02 11:03 ` Johannes Schindelin
2020-12-02 12:48 ` Jeff King
2020-12-02 22:32 ` Junio C Hamano
2020-12-01 0:46 ` [PATCH 3/4] test: completion: fix typos Felipe Contreras
2020-12-01 0:46 ` [PATCH 4/4] tests: lib-functions: trivial style cleanups Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201201004649.57548-2-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).