From d01141de5ab02cf4a156183ef4dc5ee8bf2638a3 Mon Sep 17 00:00:00 2001 From: Sergey Organov Date: Tue, 29 Sep 2020 14:31:22 +0300 Subject: diff: get rid of redundant 'dense' argument Get rid of 'dense' argument that is redundant for every function that has 'struct rev_info *rev' argument as well, as the value of 'dense' passed is always taken from 'rev->dense_combined_merges' field. The only place where this was not the case is in 'submodule.c' where 'diff_tree_combined_merge()' was called with '1' for 'dense' argument. However, at that call the 'revs' instance used is local to the function, and we now just set 'revs->dense_combined_merges' to 1 in this local instance. Signed-off-by: Sergey Organov Signed-off-by: Junio C Hamano --- diff-lib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'diff-lib.c') diff --git a/diff-lib.c b/diff-lib.c index 25fd2dee19..9b0cdbd4c7 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -177,9 +177,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option) i--; if (revs->combine_merges && num_compare_stages == 2) { - show_combined_diff(dpath, 2, - revs->dense_combined_merges, - revs); + show_combined_diff(dpath, 2, revs); free(dpath); continue; } @@ -360,7 +358,7 @@ static int show_modified(struct rev_info *revs, p->parent[1].status = DIFF_STATUS_MODIFIED; p->parent[1].mode = old_entry->ce_mode; oidcpy(&p->parent[1].oid, &old_entry->oid); - show_combined_diff(p, 2, revs->dense_combined_merges, revs); + show_combined_diff(p, 2, revs); free(p); return 0; } -- cgit v1.2.3