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 /notes-utils.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 'notes-utils.c')
-rw-r--r-- | notes-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/notes-utils.c b/notes-utils.c index 7bb3473dbe..2975dcd581 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -70,7 +70,7 @@ static combine_notes_fn parse_combine_notes_fn(const char *v) static int notes_rewrite_config(const char *k, const char *v, void *cb) { struct notes_rewrite_cfg *c = cb; - if (!prefixcmp(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) { + if (starts_with(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) { c->enabled = git_config_bool(k, v); return 0; } else if (!c->mode_from_env && !strcmp(k, "notes.rewritemode")) { @@ -85,7 +85,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb) } else if (!c->refs_from_env && !strcmp(k, "notes.rewriteref")) { /* note that a refs/ prefix is implied in the * underlying for_each_glob_ref */ - if (!prefixcmp(v, "refs/notes/")) + if (starts_with(v, "refs/notes/")) string_list_add_refs_by_glob(c->refs, v); else warning(_("Refusing to rewrite notes in %s" |