summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-03-11 03:54:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-11 07:31:07 (GMT)
commit05314efaeaa0ae7cb0aa26d6347eabfe7cd8fc43 (patch)
tree75288aa04e8f62cb91b53a84d9f44d3f2cb6e772 /t
parent9f607cd09c4c953d76de4bd18ba1c9bf6cf383cd (diff)
downloadgit-05314efaeaa0ae7cb0aa26d6347eabfe7cd8fc43.zip
git-05314efaeaa0ae7cb0aa26d6347eabfe7cd8fc43.tar.gz
git-05314efaeaa0ae7cb0aa26d6347eabfe7cd8fc43.tar.bz2
line-log: detect unsupported formats
If you use "log -L" with an output format like "--raw" or "--stat", we'll silently ignore the format and just output the normal patch. Let's detect and complain about this, which at least tells the user what's going on. The tests here aren't exhaustive over the set of all formats, but it should at least let us know if somebody breaks the format-checking. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4211-line-log.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index c9f2036..1db7bd0 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -122,4 +122,14 @@ test_expect_success '-s shows only line-log commits' '
test_cmp expect actual
'
+test_expect_success '-p shows the default patch output' '
+ git log -L1,24:b.c >expect &&
+ git log -L1,24:b.c -p >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--raw is forbidden' '
+ test_must_fail git log -L1,24:b.c --raw
+'
+
test_done