diff: don't read index when --no-index is given
[gitweb.git] / t / t4053-diff-no-index.sh
index 979e98398bebc21fe664ca4a19770e5b251bfc97..077c775e778d8527ff7cdbfc47792c0083ddf526 100755 (executable)
@@ -29,4 +29,19 @@ test_expect_success 'git diff --no-index relative path outside repo' '
        )
 '
 
+test_expect_success 'git diff --no-index with broken index' '
+       (
+               cd repo &&
+               echo broken >.git/index &&
+               git diff --no-index a ../non/git/a
+       )
+'
+
+test_expect_success 'git diff outside repo with broken index' '
+       (
+               cd repo &&
+               git diff ../non/git/a ../non/git/b
+       )
+'
+
 test_done