From: Christian Couder Date: Sat, 09 Nov 2013 07:06:18 GMT Subject: [PATCH 25/86] notes: replace prefixcmd() with has_prefix() Message-ID: <20131109070720.18178.81030.chriscool@tuxfamily.org> In-Reply-To: <20131109070358.18178.40248.chriscool@tuxfamily.org> Signed-off-by: Christian Couder --- notes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notes.c b/notes.c index b69c0b8..e23d38a 100644 --- a/notes.c +++ b/notes.c @@ -1243,9 +1243,9 @@ static void format_note(struct notes_tree *t, const unsigned char *object_sha1, if (!ref || !strcmp(ref, GIT_NOTES_DEFAULT_REF)) { strbuf_addstr(sb, "\nNotes:\n"); } else { - if (!prefixcmp(ref, "refs/")) + if (has_prefix(ref, "refs/")) ref += 5; - if (!prefixcmp(ref, "notes/")) + if (has_prefix(ref, "notes/")) ref += 6; strbuf_addf(sb, "\nNotes (%s):\n", ref); } @@ -1293,9 +1293,9 @@ int copy_note(struct notes_tree *t, void expand_notes_ref(struct strbuf *sb) { - if (!prefixcmp(sb->buf, "refs/notes/")) + if (has_prefix(sb->buf, "refs/notes/")) return; /* we're happy */ - else if (!prefixcmp(sb->buf, "notes/")) + else if (has_prefix(sb->buf, "notes/")) strbuf_insert(sb, 0, "refs/", 5); else strbuf_insert(sb, 0, "refs/notes/", 11); -- 1.8.4.1.566.geca833c