[04/10] diff: drop complete_rewrite parameter from run_external_diff()
diff mbox series

Message ID 20190214054941.GD20578@sigill.intra.peff.net
State New
Headers show
  • dropping more unused function parameters
Related show

Commit Message

Jeff King Feb. 14, 2019, 5:49 a.m. UTC
Our builtin_diff() wants to know whether break-detection found a
complete rewrite, because it changes how the diff is shown. However,
when calling out to an external diff, we don't pass this information
along (and doing so would require designing a new interface to the
user-provided program).

Let's drop the unused parameter to make this fact more clear.

Signed-off-by: Jeff King <peff@peff.net>
An alternative is to pass $COMPLETE_REWRITE in the environment. That
would avoid disrupting existing external diff callers, and they could
peek at the information if they really cared. But given that nobody has
actually asked for this, I'm inclined not to add a new interface element
that we'd then have to support forever.

 diff.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff mbox series

diff --git a/diff.c b/diff.c
index d24843b531..e3f263769b 100644
--- a/diff.c
+++ b/diff.c
@@ -4178,7 +4178,6 @@  static void run_external_diff(const char *pgm,
 			      struct diff_filespec *one,
 			      struct diff_filespec *two,
 			      const char *xfrm_msg,
-			      int complete_rewrite,
 			      struct diff_options *o)
 	struct argv_array argv = ARGV_ARRAY_INIT;
@@ -4336,8 +4335,7 @@  static void run_diff_cmd(const char *pgm,
 	if (pgm) {
-		run_external_diff(pgm, name, other, one, two, xfrm_msg,
-				  complete_rewrite, o);
+		run_external_diff(pgm, name, other, one, two, xfrm_msg, o);
 	if (one && two)