Skip to content

Commit e3c3a55

Browse files
author
Junio C Hamano
committed
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>
1 parent 2718435 commit e3c3a55

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

combine-diff.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ static void reuse_combine_diff(struct sline *sline, unsigned long cnt,
608608
}
609609

610610
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)
612612
{
613613
unsigned long size, cnt, lno;
614614
char *result, *cp, *ep;
@@ -742,8 +742,7 @@ int show_combined_diff(struct combine_diff_path *elem, int num_parent,
742742
}
743743

744744
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)
747746
{
748747
struct commit *commit = lookup_commit(sha1);
749748
struct diff_options diffopts;
@@ -777,12 +776,11 @@ int diff_tree_combined_merge(const unsigned char *sha1,
777776
if (p->len)
778777
num_paths++;
779778
}
780-
if (num_paths || show_empty_merge) {
779+
if (num_paths) {
781780
for (p = paths; p; p = p->next) {
782781
if (!p->len)
783782
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))
786784
header = NULL;
787785
}
788786
}

diff-files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int main(int argc, const char **argv)
160160
if (combine_merges && num_compare_stages == 2) {
161161
show_combined_diff(&combine.p, 2,
162162
dense_combined_merges,
163-
NULL, 0);
163+
NULL);
164164
free(combine.p.path);
165165
continue;
166166
}

diff-tree.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ static int show_root_diff = 0;
66
static int no_commit_id = 0;
77
static int verbose_header = 0;
88
static int ignore_merges = 1;
9-
static int show_empty_combined = 0;
109
static int combine_merges = 0;
1110
static int dense_combined_merges = 0;
1211
static int read_stdin = 0;
@@ -127,7 +126,6 @@ static int diff_tree_commit(const unsigned char *commit_sha1)
127126
else if (combine_merges) {
128127
header = generate_header(sha1, sha1, commit);
129128
return diff_tree_combined_merge(sha1, header,
130-
show_empty_combined,
131129
dense_combined_merges);
132130
}
133131
}
@@ -278,7 +276,6 @@ int main(int argc, const char **argv)
278276

279277
if (combine_merges) {
280278
diff_options.output_format = DIFF_FORMAT_PATCH;
281-
show_empty_combined = !ignore_merges;
282279
ignore_merges = 0;
283280
}
284281

diff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ struct combine_diff_path {
6868
};
6969

7070
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);
7272

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);
7474

7575
extern void diff_addremove(struct diff_options *,
7676
int addremove,

0 commit comments

Comments
 (0)