diff options
author | Jeff King <peff@peff.net> | 2023-01-06 06:04:18 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-06 21:50:07 +0900 |
commit | de8f14e1c01451e751da80fb6309bf4a371b5b2b (patch) | |
tree | 6deedb7a8ab13e68363ccdb9d680e266397f9639 /diff.c | |
parent | a0f83e777660dbf7d9526c05d94fc920e459aed9 (diff) | |
download | git-de8f14e1c01451e751da80fb6309bf4a371b5b2b.tar.gz |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -4278,7 +4278,6 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r, static void add_external_diff_name(struct repository *r, struct strvec *argv, - const char *name, struct diff_filespec *df) { struct diff_tempfile *temp = prepare_temp_file(r, df->path, df); @@ -4308,11 +4307,9 @@ static void run_external_diff(const char *pgm, strvec_push(&cmd.args, name); if (one && two) { - add_external_diff_name(o->repo, &cmd.args, name, one); - if (!other) - add_external_diff_name(o->repo, &cmd.args, name, two); - else { - add_external_diff_name(o->repo, &cmd.args, other, two); + add_external_diff_name(o->repo, &cmd.args, one); + add_external_diff_name(o->repo, &cmd.args, two); + if (other) { strvec_push(&cmd.args, other); strvec_push(&cmd.args, xfrm_msg); } |