@matheusbsbs / matheus-bagliano / commits / e3c3a550d4
Fork 0

combine-diff: remove misguided --show-empty hack.

Now --always flag is available in diff-tree, there is no reason to have that hack in the diffcore side. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 5, 2006 at 22:25 UTC e3c3a550d4815d34b5674776c36cdd6d8a31ab85
4 files changed +7 -12
combine-diff.c
+4 -6
@@ -608,7 +608,7 @@ static void reuse_combine_diff(struct sline *sline, unsigned long cnt,
608 }
609
610 int show_combined_diff(struct combine_diff_path *elem, int num_parent,
611 - int dense, const char *header, int show_empty)
611 + int dense, const char *header)
612 {
613 unsigned long size, cnt, lno;
614 char *result, *cp, *ep;
@@ -742,8 +742,7 @@ int show_combined_diff(struct combine_diff_path *elem, int num_parent,
742 }
743
744 int diff_tree_combined_merge(const unsigned char *sha1,
745 - const char *header,
746 - int show_empty_merge, int dense)
745 + const char *header, int dense)
746 {
747 struct commit *commit = lookup_commit(sha1);
748 struct diff_options diffopts;
@@ -777,12 +776,11 @@ int diff_tree_combined_merge(const unsigned char *sha1,
776 if (p->len)
777 num_paths++;
778 }
780 - if (num_paths || show_empty_merge) {
779 + if (num_paths) {
780 for (p = paths; p; p = p->next) {
781 if (!p->len)
782 continue;
784 - if (show_combined_diff(p, num_parent, dense, header,
785 - show_empty_merge))
783 + if (show_combined_diff(p, num_parent, dense, header))
784 header = NULL;
785 }
786 }
diff-files.c
+1 -1
@@ -160,7 +160,7 @@ int main(int argc, const char **argv)
160 if (combine_merges && num_compare_stages == 2) {
161 show_combined_diff(&combine.p, 2,
162 dense_combined_merges,
163 - NULL, 0);
163 + NULL);
164 free(combine.p.path);
165 continue;
166 }
diff-tree.c
-3
@@ -6,7 +6,6 @@ static int show_root_diff = 0;
6 static int no_commit_id = 0;
7 static int verbose_header = 0;
8 static int ignore_merges = 1;
9 -static int show_empty_combined = 0;
9 static int combine_merges = 0;
10 static int dense_combined_merges = 0;
11 static int read_stdin = 0;
@@ -127,7 +126,6 @@ static int diff_tree_commit(const unsigned char *commit_sha1)
126 else if (combine_merges) {
127 header = generate_header(sha1, sha1, commit);
128 return diff_tree_combined_merge(sha1, header,
130 - show_empty_combined,
129 dense_combined_merges);
130 }
131 }
@@ -278,7 +276,6 @@ int main(int argc, const char **argv)
276
277 if (combine_merges) {
278 diff_options.output_format = DIFF_FORMAT_PATCH;
281 - show_empty_combined = !ignore_merges;
279 ignore_merges = 0;
280 }
281
diff.h
+2 -2
@@ -68,9 +68,9 @@ struct combine_diff_path {
68 };
69
70 int show_combined_diff(struct combine_diff_path *elem, int num_parent,
71 - int dense, const char *header, int show_empty);
71 + int dense, const char *header);
72
73 -extern int diff_tree_combined_merge(const unsigned char *sha1, const char *, int, int);
73 +extern int diff_tree_combined_merge(const unsigned char *sha1, const char *, int);
74
75 extern void diff_addremove(struct diff_options *,
76 int addremove,