Merge branch 'tz/git-svn-doc-markup-fix'
[gitweb.git] / t / t4211-line-log.sh
index 436b13ad21d06351ef9f9a027689a7e23ca97ba5..1db7bd0f59b46768d6559c37e026cde41821763a 100755 (executable)
@@ -25,7 +25,7 @@ canned_test_failure () {
 test_bad_opts () {
        test_expect_success "invalid args: $1" "
                test_must_fail git log $1 2>errors &&
-               grep '$2' errors
+               test_i18ngrep '$2' errors
        "
 }
 
@@ -101,7 +101,7 @@ test_expect_success '-L with --first-parent and a merge' '
 test_expect_success '-L with --output' '
        git checkout parallel-change &&
        git log --output=log -L :main:b.c >output &&
-       test ! -s output &&
+       test_must_be_empty output &&
        test_line_count = 70 log
 '
 
@@ -115,4 +115,21 @@ test_expect_success 'range_set_union' '
        git log $(for x in $(test_seq 200); do echo -L $((2*x)),+1:c.c; done)
 '
 
+test_expect_success '-s shows only line-log commits' '
+       git log --format="commit %s" -L1,24:b.c >expect.raw &&
+       grep ^commit expect.raw >expect &&
+       git log --format="commit %s" -L1,24:b.c -s >actual &&
+       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