summaryrefslogtreecommitdiff
path: root/connected.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 /connected.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 'connected.c')
-rw-r--r--connected.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/connected.c b/connected.c
index fae8d64c12..be9304e161 100644
--- a/connected.c
+++ b/connected.c
@@ -38,7 +38,7 @@ int check_everything_connected_with_transport(sha1_iterate_fn fn,
if (transport && transport->smart_options &&
transport->smart_options->self_contained_and_connected &&
transport->pack_lockfile &&
- !suffixcmp(transport->pack_lockfile, ".keep")) {
+ has_suffix(transport->pack_lockfile, ".keep")) {
struct strbuf idx_file = STRBUF_INIT;
strbuf_addstr(&idx_file, transport->pack_lockfile);
strbuf_setlen(&idx_file, idx_file.len - 5); /* ".keep" */