Merge branch 'jt/tag-following-with-proto-v2-fix'
[gitweb.git] / t / t5520-pull.sh
index 59c4b778d3a455b6ef4575a4b07b860d1e84720d..68aa5f0340132e8d3fabfd85aa70f1cdfe755cf3 100755 (executable)
@@ -618,6 +618,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 &&