summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-11-20 15:48:29 -0400
committerJoey Hess <joey@kitenet.net>2013-11-20 15:48:29 -0400
commitd5e0cb2d1e58cf67d33b33cdeb0b9de443164255 (patch)
treedb15394d4cdce3c343ce170eecbc72f9befbd987
parent04f96ca7e10310c352ecf046792fc14fde1928bf (diff)
downloadgit-repair-d5e0cb2d1e58cf67d33b33cdeb0b9de443164255.tar.gz
tighten up invalid HEAD detection
Must contains "ref: refs/" or git rejects it
-rw-r--r--Git/Repair.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Git/Repair.hs b/Git/Repair.hs
index c21d35d..7945bcb 100644
--- a/Git/Repair.hs
+++ b/Git/Repair.hs
@@ -467,7 +467,7 @@ preRepair g = do
writeFile headfile "ref: refs/heads/master"
where
headfile = localGitDir g </> "HEAD"
- validhead s = "ref: " `isPrefixOf` s || isJust (extractSha s)
+ validhead s = "ref: refs/" `isPrefixOf` s || isJust (extractSha s)
{- Put it all together. -}
runRepair :: Bool -> Repo -> IO (Bool, MissingObjects, [Branch])