summaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2013-11-05 22:02:36 +0100
committerJunio C Hamano <gitster@pobox.com>2013-11-06 13:10:33 -0800
commit76e08227e5bc8b6e3d208da965d2421911d25ae3 (patch)
treefffe84cc3010906389eab2e95f80988f1fff4056 /builtin/remote.c
parentd2e146d8d7052b8482859e64daf2b86c019531f8 (diff)
downloadgit-cc/remote-remove-redundant-postfixcmp.tar.gz
Rename suffixcmp() to has_suffix() and invert its resultcc/remote-remove-redundant-postfixcmp
Now has_suffix() returns 1 when the suffix is present and 0 otherwise. The old name followed the pattern anything-cmp(), which suggests a general comparison function suitable for e.g. sorting objects. But this was not the case for suffixcmp(). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/remote.c')
-rw-r--r--builtin/remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 9b3a98e415..b9a1024cc4 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -269,13 +269,13 @@ static int config_read_branches(const char *key, const char *value, void *cb)
enum { REMOTE, MERGE, REBASE } type;
key += 7;
- if (!suffixcmp(key, ".remote")) {
+ if (has_suffix(key, ".remote")) {
name = xstrndup(key, strlen(key) - 7);
type = REMOTE;
- } else if (!suffixcmp(key, ".merge")) {
+ } else if (has_suffix(key, ".merge")) {
name = xstrndup(key, strlen(key) - 6);
type = MERGE;
- } else if (!suffixcmp(key, ".rebase")) {
+ } else if (has_suffix(key, ".rebase")) {
name = xstrndup(key, strlen(key) - 7);
type = REBASE;
} else