diff-files: avoid negative exit value
commitf126f6ec221ec9f8aac3f1aebf855bbc46e9b796
authorJeff King <peff@peff.net>
Mon, 21 Aug 2023 20:15:10 +0000 (21 16:15 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Aug 2023 22:33:24 +0000 (21 15:33 -0700)
tree48ebd28097b5d4c1196703e837f8e5764617e708
parent976b97e3fd95d5daa38ed453349f5a92157a1db2
diff-files: avoid negative exit value

If loading the index fails, we print an error and then return "-1" from
the function. But since this is a builtin, we end up with exit(-1),
which produces odd results since program exit codes are unsigned.
Because of integer conversion, it usually becomes 255, which is at least
still an error, but values above 128 are usually interpreted as signal
death.

Since we know the program is exiting immediately, we can just replace
the error return with a die().

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