From: Christian Couder <chriscool@tuxfamily.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Antoine Pelisse <apelisse@gmail.com>,
Avery Pennarun <apenwarr@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Jonathan Nieder <jrnieder@gmail.com>, Max Horn <max@quendi.de>,
Andreas Ericsson <ae@op5.se>
Subject: [PATCH 1/5] environment: normalize use of prefixcmp() by removing " != 0"
Date: Sun, 01 Dec 2013 08:49:14 +0100 [thread overview]
Message-ID: <20131201074919.3042.88989.chriscool@tuxfamily.org> (raw)
In-Reply-To: <20131201074818.3042.57357.chriscool@tuxfamily.org>
To be able to automatically convert prefixcmp() to starts_with()
we need first to make sure that prefixcmp() is always used in
the same way.
So let's remove " != 0" after prefixcmp().
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
environment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/environment.c b/environment.c
index 0a15349..cd2b068 100644
--- a/environment.c
+++ b/environment.c
@@ -171,7 +171,7 @@ const char *get_git_namespace(void)
const char *strip_namespace(const char *namespaced_ref)
{
- if (prefixcmp(namespaced_ref, get_git_namespace()) != 0)
+ if (prefixcmp(namespaced_ref, get_git_namespace()))
return NULL;
return namespaced_ref + namespace_len;
}
--
1.8.4.1.561.g12affca
next prev parent reply other threads:[~2013-12-01 7:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
2013-12-01 7:49 ` Christian Couder [this message]
2013-12-01 7:49 ` [PATCH 2/5] builtin/remote: remove postfixcmp() and use suffixcmp() instead Christian Couder
2013-12-01 7:49 ` [PATCH 3/5] strbuf: introduce starts_with() and ends_with() Christian Couder
2013-12-01 7:49 ` [PATCH 5/5] strbuf: remove prefixcmp() and suffixcmp() Christian Couder
2013-12-02 15:09 ` [PATCH 0/5] use starts_with() and ends_with() Jeff King
2013-12-02 18:32 ` Junio C Hamano
2013-12-02 19:29 ` Christian Couder
2013-12-02 19:32 ` Antoine Pelisse
2013-12-03 6:06 ` Christian Couder
[not found] ` <20131201074919.3042.92026.chriscool@tuxfamily.org>
[not found] ` <CAP8UFD0jg_Vr7Zf+DiMX9RG6vmmQvmk2NvmL7j=MC-x3fLOOBA@mail.gmail.com>
2013-12-03 12:46 ` Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with() Jeff King
2013-12-03 20:24 ` Christian Couder
2013-12-04 19:45 ` Jeff King
2013-12-04 20:51 ` Junio C Hamano
2013-12-04 22:02 ` Junio C Hamano
2013-12-05 7:19 ` Christian Couder
2013-12-05 18:04 ` Junio C Hamano
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=20131201074919.3042.88989.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=ae@op5.se \
--cc=apelisse@gmail.com \
--cc=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=max@quendi.de \
--cc=peff@peff.net \
/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).