Upgrading a direct mode repository to v6 has changed to enter an adjusted unlocked branch.

This makes the direct mode to v6 upgrade able to be performed in one clone
of a repository without affecting other clones, which can continue using v5
and direct mode.
This commit is contained in:
Joey Hess 2016-04-04 13:17:24 -04:00
parent c7b06b879b
commit c3e0859846
Failed to extract signature
7 changed files with 54 additions and 43 deletions

View file

@ -18,6 +18,12 @@ import Data.Char (chr)
headRef :: Ref
headRef = Ref "HEAD"
headFile :: Repo -> FilePath
headFile r = localGitDir r </> "HEAD"
setHeadRef :: Ref -> Repo -> IO ()
setHeadRef ref r = writeFile (headFile r) ("ref: " ++ fromRef ref)
{- Converts a fully qualified git ref into a user-visible string. -}
describe :: Ref -> String
describe = fromRef . base