Merge branch 'jk/diff-follow-must-take-one-pathspec'
[gitweb.git] / builtin / log.c
index 00a4ce602cc3f6784bb51784766c9ef2f655f0e9..3b6a6bbaddc8795c148763bb6d71136900a8fbb4 100644 (file)
@@ -387,7 +387,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
                default_show_root = git_config_bool(var, value);
                return 0;
        }
-       if (!prefixcmp(var, "color.decorate."))
+       if (starts_with(var, "color.decorate."))
                return parse_decorate_color_config(var, 15, value);
        if (!strcmp(var, "log.mailmap")) {
                use_mailmap_config = git_config_bool(var, value);
@@ -473,7 +473,7 @@ static int show_tag_object(const unsigned char *sha1, struct rev_info *rev)
                int new_offset = offset + 1;
                while (new_offset < size && buf[new_offset++] != '\n')
                        ; /* do nothing */
-               if (!prefixcmp(buf + offset, "tagger "))
+               if (starts_with(buf + offset, "tagger "))
                        show_tagger(buf + offset + 7,
                                    new_offset - offset - 7, rev);
                offset = new_offset;
@@ -499,7 +499,7 @@ static void show_rev_tweak_rev(struct rev_info *rev, struct setup_revision_opt *
                /* There was no "-m" on the command line */
                rev->ignore_merges = 0;
                if (!rev->first_parent_only && !rev->combine_merges) {
-                       /* No "--first-parent", "-c", nor "--cc" */
+                       /* No "--first-parent", "-c", or "--cc" */
                        rev->combine_merges = 1;
                        rev->dense_combined_merges = 1;
                }
@@ -878,7 +878,7 @@ static char *find_branch_name(struct rev_info *rev)
        ref = rev->cmdline.rev[positive].name;
        tip_sha1 = rev->cmdline.rev[positive].item->sha1;
        if (dwim_ref(ref, strlen(ref), branch_sha1, &full_ref) &&
-           !prefixcmp(full_ref, "refs/heads/") &&
+           starts_with(full_ref, "refs/heads/") &&
            !hashcmp(tip_sha1, branch_sha1))
                branch = xstrdup(full_ref + strlen("refs/heads/"));
        free(full_ref);
@@ -1384,7 +1384,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                        unsigned char sha1[20];
                        const char *ref;
                        ref = resolve_ref_unsafe("HEAD", sha1, 1, NULL);
-                       if (ref && !prefixcmp(ref, "refs/heads/"))
+                       if (ref && starts_with(ref, "refs/heads/"))
                                branch_name = xstrdup(ref + strlen("refs/heads/"));
                        else
                                branch_name = xstrdup(""); /* no branch */