]> git.ipfire.org Git - thirdparty/git.git/commit
diff: factor out src/dst prefix setup
authorJeff King <peff@peff.net>
Thu, 9 Mar 2023 06:07:06 +0000 (01:07 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Mar 2023 16:32:17 +0000 (08:32 -0800)
commit6799aadfdf484135476aaf74f5d2eb825d9f00e8
tree5bf49e1c185e24942b1c398f6f9d1cfc028aaab1
parent725f57037d81e24eacfda6e59a19c60c0b4c8062
diff: factor out src/dst prefix setup

We directly manipulate diffopt's a_prefix and b_prefix to set up either
the default "a/foo" prefix or the "--no-prefix" variant. Although this
is only a few lines, it's worth pulling these into their own functions.
That lets us avoid one repetition already in this patch, but will also
give us a cleaner interface for callers which want to tweak this
setting.

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