Merge branch 'nd/no-the-index'
[gitweb.git] / t / t5520-pull.sh
index 07e4c7f9ab3605c728035a63347cfe5bd79efab0..5e501c8b08868b17478b8baa91db2cd129cd1c67 100755 (executable)
@@ -630,6 +630,18 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
        )
 '
 
+test_expect_success 'pull --rebase fails on corrupt HEAD' '
+       test_when_finished "rm -rf corrupt" &&
+       git init corrupt &&
+       (
+               cd corrupt &&
+               test_commit one &&
+               obj=$(git rev-parse --verify HEAD | sed "s#^..#&/#") &&
+               rm -f .git/objects/$obj &&
+               test_must_fail git pull --rebase
+       )
+'
+
 test_expect_success 'setup for detecting upstreamed changes' '
        mkdir src &&
        (cd src &&