summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-10-05 21:01:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-05 21:01:51 (GMT)
commit34415c76c8f67c8692090ef4911d1626689e8f38 (patch)
tree394d71e84f1909532a6a0e1654d3ff314a9bd39b /combine-diff.c
parent58138d3f266569f945a7abc86fc897111c47640f (diff)
parentd01141de5ab02cf4a156183ef4dc5ee8bf2638a3 (diff)
downloadgit-34415c76c8f67c8692090ef4911d1626689e8f38.zip
git-34415c76c8f67c8692090ef4911d1626689e8f38.tar.gz
git-34415c76c8f67c8692090ef4911d1626689e8f38.tar.bz2
Merge branch 'so/combine-diff-simplify'
Code simplification. * so/combine-diff-simplify: diff: get rid of redundant 'dense' argument
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 002e0e5..555b812 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -923,7 +923,6 @@ static void dump_quoted_path(const char *head,
static void show_combined_header(struct combine_diff_path *elem,
int num_parent,
- int dense,
struct rev_info *rev,
const char *line_prefix,
int mode_differs,
@@ -939,6 +938,7 @@ static void show_combined_header(struct combine_diff_path *elem,
int added = 0;
int deleted = 0;
int i;
+ int dense = rev->dense_combined_merges;
if (rev->loginfo && !rev->no_commit_id)
show_log(rev);
@@ -1012,7 +1012,7 @@ static void show_combined_header(struct combine_diff_path *elem,
}
static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
- int dense, int working_tree_file,
+ int working_tree_file,
struct rev_info *rev)
{
struct diff_options *opt = &rev->diffopt;
@@ -1145,7 +1145,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
}
}
if (is_binary) {
- show_combined_header(elem, num_parent, dense, rev,
+ show_combined_header(elem, num_parent, rev,
line_prefix, mode_differs, 0);
printf("Binary files differ\n");
free(result);
@@ -1200,10 +1200,10 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
textconv, elem->path, opt->xdl_opts);
}
- show_hunks = make_hunks(sline, cnt, num_parent, dense);
+ show_hunks = make_hunks(sline, cnt, num_parent, rev->dense_combined_merges);
if (show_hunks || mode_differs || working_tree_file) {
- show_combined_header(elem, num_parent, dense, rev,
+ show_combined_header(elem, num_parent, rev,
line_prefix, mode_differs, 1);
dump_sline(sline, line_prefix, cnt, num_parent,
opt->use_color, result_deleted);
@@ -1284,7 +1284,6 @@ static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct re
*/
void show_combined_diff(struct combine_diff_path *p,
int num_parent,
- int dense,
struct rev_info *rev)
{
struct diff_options *opt = &rev->diffopt;
@@ -1294,7 +1293,7 @@ void show_combined_diff(struct combine_diff_path *p,
DIFF_FORMAT_NAME_STATUS))
show_raw_diff(p, num_parent, rev);
else if (opt->output_format & DIFF_FORMAT_PATCH)
- show_patch_diff(p, num_parent, dense, 1, rev);
+ show_patch_diff(p, num_parent, 1, rev);
}
static void free_combined_pair(struct diff_filepair *pair)
@@ -1454,7 +1453,6 @@ static struct combine_diff_path *find_paths_multitree(
void diff_tree_combined(const struct object_id *oid,
const struct oid_array *parents,
- int dense,
struct rev_info *rev)
{
struct diff_options *opt = &rev->diffopt;
@@ -1581,8 +1579,7 @@ void diff_tree_combined(const struct object_id *oid,
printf("%s%c", diff_line_prefix(opt),
opt->line_termination);
for (p = paths; p; p = p->next)
- show_patch_diff(p, num_parent, dense,
- 0, rev);
+ show_patch_diff(p, num_parent, 0, rev);
}
}
@@ -1600,7 +1597,7 @@ void diff_tree_combined(const struct object_id *oid,
clear_pathspec(&diffopts.pathspec);
}
-void diff_tree_combined_merge(const struct commit *commit, int dense,
+void diff_tree_combined_merge(const struct commit *commit,
struct rev_info *rev)
{
struct commit_list *parent = get_saved_parents(rev, commit);
@@ -1610,6 +1607,6 @@ void diff_tree_combined_merge(const struct commit *commit, int dense,
oid_array_append(&parents, &parent->item->object.oid);
parent = parent->next;
}
- diff_tree_combined(&commit->object.oid, &parents, dense, rev);
+ diff_tree_combined(&commit->object.oid, &parents, rev);
oid_array_clear(&parents);
}