summaryrefslogtreecommitdiff
path: root/builtin/archive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-17 19:47:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-17 20:02:44 (GMT)
commitad7044857660af7ffaaf8fbbccc77b817d1b938f (patch)
treeb77a7390dbbc1901e13d74c1738f327e5fa8154d /builtin/archive.c
parent14a9c5f261bcc436b80700076257f02af0beec68 (diff)
parent59556548230e617b837343c2c07e357e688e2ca4 (diff)
downloadgit-ad7044857660af7ffaaf8fbbccc77b817d1b938f.zip
git-ad7044857660af7ffaaf8fbbccc77b817d1b938f.tar.gz
git-ad7044857660af7ffaaf8fbbccc77b817d1b938f.tar.bz2
Merge branch 'cc/starts-n-ends-with'
Remove a few duplicate implementations of prefix/suffix comparison functions, and rename them to starts_with and ends_with. * cc/starts-n-ends-with: replace {pre,suf}fixcmp() with {starts,ends}_with() strbuf: introduce starts_with() and ends_with() builtin/remote: remove postfixcmp() and use suffixcmp() instead environment: normalize use of prefixcmp() by removing " != 0"
Diffstat (limited to 'builtin/archive.c')
-rw-r--r--builtin/archive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/archive.c b/builtin/archive.c
index 49178f1..a1e3b94 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -57,9 +57,9 @@ static int run_remote_archiver(int argc, const char **argv,
if (!buf)
die(_("git archive: expected ACK/NAK, got EOF"));
if (strcmp(buf, "ACK")) {
- if (!prefixcmp(buf, "NACK "))
+ if (starts_with(buf, "NACK "))
die(_("git archive: NACK %s"), buf + 5);
- if (!prefixcmp(buf, "ERR "))
+ if (starts_with(buf, "ERR "))
die(_("remote error: %s"), buf + 4);
die(_("git archive: protocol error"));
}