[PATCH 52/86] builtin/commit: replace prefixcmd() with has_prefix()
STALE3764d
From: Christian Couder <hidden>
Date: 2016-06-15 22:59:12
Subsystem:
the rest · Maintainer:
Linus Torvalds
Signed-off-by: Christian Couder <redacted> --- builtin/commit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 6ab4605..a8c46c6 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c@@ -733,7 +733,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, eol = nl - sb.buf; else eol = sb.len; - if (!prefixcmp(sb.buf + previous, "\nConflicts:\n")) { + if (has_prefix(sb.buf + previous, "\nConflicts:\n")) { ignore_footer = sb.len - previous; break; }
@@ -904,7 +904,7 @@ static int rest_is_empty(struct strbuf *sb, int start) eol = sb->len; if (strlen(sign_off_header) <= eol - i && - !prefixcmp(sb->buf + i, sign_off_header)) { + has_prefix(sb->buf + i, sign_off_header)) { i = eol; continue; }
@@ -1183,7 +1183,7 @@ static int git_status_config(const char *k, const char *v, void *cb) { struct wt_status *s = cb; - if (!prefixcmp(k, "column.")) + if (has_prefix(k, "column.")) return git_column_config(k, v, "status", &s->colopts); if (!strcmp(k, "status.submodulesummary")) { int is_bool;
@@ -1211,7 +1211,7 @@ static int git_status_config(const char *k, const char *v, void *cb) s->display_comment_prefix = git_config_bool(k, v); return 0; } - if (!prefixcmp(k, "status.color.") || !prefixcmp(k, "color.status.")) { + if (has_prefix(k, "status.color.") || has_prefix(k, "color.status.")) { int slot = parse_status_slot(k, 13); if (slot < 0) return 0;
@@ -1377,7 +1377,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1, head = resolve_ref_unsafe("HEAD", junk_sha1, 0, NULL); printf("[%s%s ", - !prefixcmp(head, "refs/heads/") ? + has_prefix(head, "refs/heads/") ? head + 11 : !strcmp(head, "HEAD") ? _("detached HEAD") :
--
1.8.4.1.566.geca833c