Skip to content

Commit de8f14e

Browse files
peffgitster
authored andcommitted
diff: clean up external-diff argv setup
Since the previous commit, setting up the tempfile for an external diff uses df->path from the diff_filespec, rather than the logical name. This means add_external_diff_name() does not need to take a "name" parameter at all, and we can drop it. And that in turn lets us simplify the conditional for handling renames (when the "other" name is non-NULL). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0f83e7 commit de8f14e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

diff.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,7 +4278,6 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
42784278

42794279
static void add_external_diff_name(struct repository *r,
42804280
struct strvec *argv,
4281-
const char *name,
42824281
struct diff_filespec *df)
42834282
{
42844283
struct diff_tempfile *temp = prepare_temp_file(r, df->path, df);
@@ -4308,11 +4307,9 @@ static void run_external_diff(const char *pgm,
43084307
strvec_push(&cmd.args, name);
43094308

43104309
if (one && two) {
4311-
add_external_diff_name(o->repo, &cmd.args, name, one);
4312-
if (!other)
4313-
add_external_diff_name(o->repo, &cmd.args, name, two);
4314-
else {
4315-
add_external_diff_name(o->repo, &cmd.args, other, two);
4310+
add_external_diff_name(o->repo, &cmd.args, one);
4311+
add_external_diff_name(o->repo, &cmd.args, two);
4312+
if (other) {
43164313
strvec_push(&cmd.args, other);
43174314
strvec_push(&cmd.args, xfrm_msg);
43184315
}

0 commit comments

Comments
 (0)