diff options
| author | Junio C Hamano <gitster@pobox.com> | 2013-12-17 11:47:35 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2013-12-17 12:02:44 -0800 |
| commit | ad7044857660af7ffaaf8fbbccc77b817d1b938f (patch) | |
| tree | b77a7390dbbc1901e13d74c1738f327e5fa8154d /builtin/send-pack.c | |
| parent | 14a9c5f261bcc436b80700076257f02af0beec68 (diff) | |
| parent | 59556548230e617b837343c2c07e357e688e2ca4 (diff) | |
| download | git-ad7044857660af7ffaaf8fbbccc77b817d1b938f.tar.gz | |
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/send-pack.c')
| -rw-r--r-- | builtin/send-pack.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c index 4482f16efb..e7f0b97d31 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -115,15 +115,15 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) const char *arg = *argv; if (*arg == '-') { - if (!prefixcmp(arg, "--receive-pack=")) { + if (starts_with(arg, "--receive-pack=")) { receivepack = arg + 15; continue; } - if (!prefixcmp(arg, "--exec=")) { + if (starts_with(arg, "--exec=")) { receivepack = arg + 7; continue; } - if (!prefixcmp(arg, "--remote=")) { + if (starts_with(arg, "--remote=")) { remote_name = arg + 9; continue; } @@ -181,7 +181,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) exit(1); continue; } - if (!prefixcmp(arg, "--" CAS_OPT_NAME "=")) { + if (starts_with(arg, "--" CAS_OPT_NAME "=")) { if (parse_push_cas_option(&cas, strchr(arg, '=') + 1, 0) < 0) exit(1); |
