]> git.ipfire.org Git - thirdparty/git.git/commit
diff: drop "name" parameter from prepare_temp_file()
authorJeff King <peff@peff.net>
Fri, 6 Jan 2023 11:05:00 +0000 (06:05 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Jan 2023 12:50:09 +0000 (21:50 +0900)
commitf034bb1cad862a678030cdf0ae833636f9d7dbca
treefd9391b196cb39e230af0c6699f8ce4bb392a05f
parentde8f14e1c01451e751da80fb6309bf4a371b5b2b
diff: drop "name" parameter from prepare_temp_file()

The prepare_temp_file() function takes a diff_filespec as well as a
filename. But it is almost certainly an error to pass in a name that
isn't the filespec's "path" parameter, since that is the only thing that
reliably tells us how to find the content (and indeed, this was the
source of a recently-fixed bug).

So let's drop the redundant "name" parameter and just use one->path
throughout the function. This simplifies the interface a little bit, and
makes it impossible for calling code to get it wrong.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c