diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-04-04 13:17:24 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-04-04 13:17:24 -0400 |
commit | 9b3a2e6c91afb886f1743769a5100fcf056d6ea7 (patch) | |
tree | 282232aee8154832c631d9c7efc87062140051fe /Git/Ref.hs | |
parent | f312b66a5cfc99ca5f01a07755f645659e75564a (diff) |
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.
Diffstat (limited to 'Git/Ref.hs')
-rw-r--r-- | Git/Ref.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Git/Ref.hs b/Git/Ref.hs index 7f21b0ab8..6cd56271f 100644 --- a/Git/Ref.hs +++ b/Git/Ref.hs @@ -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 |