Make sha1flush void and remove conditional return.
[gitweb.git] / combine-diff.c
index ba8baca0ab9f2c3c48b4678108d4a62c1f9f8fd9..4c6bfed56ee0fe3c84124e0b9a9c5bb80c9abcf2 100644 (file)
@@ -7,13 +7,6 @@
 #include "xdiff-interface.h"
 #include "log-tree.h"
 
-static int uninteresting(struct diff_filepair *p)
-{
-       if (diff_unmodified_pair(p))
-               return 1;
-       return 0;
-}
-
 static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr, int n, int num_parent)
 {
        struct diff_queue_struct *q = &diff_queued_diff;
@@ -25,7 +18,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr,
                for (i = 0; i < q->nr; i++) {
                        int len;
                        const char *path;
-                       if (uninteresting(q->queue[i]))
+                       if (diff_unmodified_pair(q->queue[i]))
                                continue;
                        path = q->queue[i]->two->path;
                        len = strlen(path);
@@ -57,7 +50,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr,
                        const char *path;
                        int len;
 
-                       if (uninteresting(q->queue[i]))
+                       if (diff_unmodified_pair(q->queue[i]))
                                continue;
                        path = q->queue[i]->two->path;
                        len = strlen(path);
@@ -609,15 +602,15 @@ static void dump_quoted_path(const char *prefix, const char *path,
        printf("%s\n", c_reset);
 }
 
-static int show_patch_diff(struct combine_diff_path *elem, int num_parent,
-                          int dense, struct rev_info *rev)
+static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
+                           int dense, struct rev_info *rev)
 {
        struct diff_options *opt = &rev->diffopt;
        unsigned long result_size, cnt, lno;
        char *result, *cp;
        struct sline *sline; /* survived lines */
        int mode_differs = 0;
-       int i, show_hunks, shown_header = 0;
+       int i, show_hunks;
        int working_tree_file = !memcmp(elem->sha1, null_sha1, 20);
        int abbrev = opt->full_index ? 40 : DEFAULT_ABBREV;
        mmfile_t result_file;
@@ -769,7 +762,6 @@ static int show_patch_diff(struct combine_diff_path *elem, int num_parent,
        }
        free(sline[0].p_lno);
        free(sline);
-       return shown_header;
 }
 
 #define COLONS "::::::::::::::::::::::::::::::::"
@@ -837,11 +829,10 @@ void show_combined_diff(struct combine_diff_path *p,
                return;
        if (opt->output_format & (DIFF_FORMAT_RAW |
                                  DIFF_FORMAT_NAME |
-                                 DIFF_FORMAT_NAME_STATUS)) {
+                                 DIFF_FORMAT_NAME_STATUS))
                show_raw_diff(p, num_parent, rev);
-       } else if (opt->output_format & DIFF_FORMAT_PATCH) {
+       else if (opt->output_format & DIFF_FORMAT_PATCH)
                show_patch_diff(p, num_parent, dense, rev);
-       }
 }
 
 void diff_tree_combined(const unsigned char *sha1,