]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4202-log.sh
diff: detect pathspec magic not supported by --follow
[thirdparty/git.git] / t / t4202-log.sh
index 2ce2b41174d501f998b9e9edb4faa8ba969629f6..b1f49d29546cfa4eab82416bde576d52b2100408 100755 (executable)
@@ -187,6 +187,21 @@ test_expect_success 'git config log.follow does not die with no paths' '
        git log --
 '
 
+test_expect_success 'git log --follow rejects unsupported pathspec magic' '
+       test_must_fail git log --follow ":(top,glob,icase)ichi" 2>stderr &&
+       # check full error message; we want to be sure we mention both
+       # of the rejected types (glob,icase), but not the allowed one (top)
+       echo "fatal: pathspec magic not supported by --follow: ${SQ}glob${SQ}, ${SQ}icase${SQ}" >expect &&
+       test_cmp expect stderr
+'
+
+test_expect_success 'log.follow disabled with unsupported pathspec magic' '
+       test_config log.follow true &&
+       git log --format=%s ":(glob,icase)ichi" >actual &&
+       echo third >expect &&
+       test_cmp expect actual
+'
+
 test_expect_success 'git config log.follow is overridden by --no-follow' '
        test_config log.follow true &&
        git log --no-follow --pretty="format:%s" ichi >actual &&