mailinfo: do not let handle_boundary() touch global "line" directly
[gitweb.git] / builtin / log.c
index 865110534d848e418457bda71ff860aeb010bb44..a491d3dea0e412624e7212060658e22a421cdfbf 100644 (file)
@@ -342,8 +342,7 @@ static int cmd_log_walk(struct rev_info *rev)
         * retain that state information if replacing rev->diffopt in this loop
         */
        while ((commit = get_revision(rev)) != NULL) {
-               if (!log_tree_commit(rev, commit) &&
-                   rev->max_count >= 0)
+               if (!log_tree_commit(rev, commit) && rev->max_count >= 0)
                        /*
                         * We decremented max_count in get_revision,
                         * but we didn't actually show the commit.
@@ -633,6 +632,14 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
        if (DIFF_OPT_TST(&rev->diffopt, DEFAULT_FOLLOW_RENAMES) &&
            rev->prune_data.nr == 1)
                DIFF_OPT_SET(&rev->diffopt, FOLLOW_RENAMES);
+
+       /* Turn --cc/-c into -p --cc/-c when -p was not given */
+       if (!rev->diffopt.output_format && rev->combine_merges)
+               rev->diffopt.output_format = DIFF_FORMAT_PATCH;
+
+       /* Turn -m on when --cc/-c was given */
+       if (rev->combine_merges)
+               rev->ignore_merges = 0;
 }
 
 int cmd_log(int argc, const char **argv, const char *prefix)
@@ -1456,8 +1463,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                        continue;
                }
 
-               if (ignore_if_in_upstream &&
-                               has_commit_patch_id(commit, &ids))
+               if (ignore_if_in_upstream && has_commit_patch_id(commit, &ids))
                        continue;
 
                nr++;