diff options
| author | Jeff King <peff@peff.net> | 2023-03-09 01:09:54 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-03-09 08:32:21 -0800 |
| commit | b39a5697296659c344cd0a286b51303fd5375fab (patch) | |
| tree | fae2ab944498606552c29e45339ec259f2b4f769 /t/t4013-diff-various.sh | |
| parent | t4013: add tests for diff prefix options (diff) | |
| download | git-b39a5697296659c344cd0a286b51303fd5375fab.tar.gz git-b39a5697296659c344cd0a286b51303fd5375fab.zip | |
diff: add --default-prefix option
You can change the output of prefixes with diff.noprefix and
diff.mnemonicprefix, but there's no easy way to override them from the
command-line. We do have "--no-prefix", but there's no way to get back
to the default prefix. So let's add an option to do that.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013-diff-various.sh')
| -rwxr-xr-x | t/t4013-diff-various.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 0bc6957989..5de1d19075 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -643,9 +643,19 @@ test_expect_success 'diff respects diff.noprefix' ' check_prefix actual file0 file0 ' +test_expect_success 'diff --default-prefix overrides diff.noprefix' ' + git -c diff.noprefix diff --default-prefix >actual && + check_prefix actual a/file0 b/file0 +' + test_expect_success 'diff respects diff.mnemonicprefix' ' git -c diff.mnemonicprefix diff >actual && check_prefix actual i/file0 w/file0 ' +test_expect_success 'diff --default-prefix overrides diff.mnemonicprefix' ' + git -c diff.mnemonicprefix diff --default-prefix >actual && + check_prefix actual a/file0 b/file0 +' + test_done |
