summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-05 16:42:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-05 17:05:03 -0400
commit4f6c8222072ace33e3acedddd31637089ae474b6 (patch)
tree720d851820dd6ccc51e5393f2dc87818141ec2ed /Git
parentda9eea5dc0e86b4abb14064346eddc5689d94333 (diff)
v5 for direct mode, with automatic upgrade
This includes storing the current state of the HEAD ref, which git annex sync is going to need, but does not make sync use it.
Diffstat (limited to 'Git')
-rw-r--r--Git/Ref.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Git/Ref.hs b/Git/Ref.hs
index 954b61a2e..9706f8b6c 100644
--- a/Git/Ref.hs
+++ b/Git/Ref.hs
@@ -40,6 +40,11 @@ exists :: Ref -> Repo -> IO Bool
exists ref = runBool
[Param "show-ref", Param "--verify", Param "-q", Param $ show ref]
+{- The file used to record a ref. (Git also stores some refs in a
+ - packed-refs file.) -}
+file :: Ref -> Repo -> FilePath
+file ref repo = localGitDir repo </> show ref
+
{- Checks if HEAD exists. It generally will, except for in a repository
- that was just created. -}
headExists :: Repo -> IO Bool