aboutsummaryrefslogtreecommitdiff
path: root/Command/Proxy.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-03-04 15:25:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-03-04 15:25:35 -0400
commit15ffb8b60e26bd8707c132f2452cb4adbe7e6d02 (patch)
tree3db0ba20a0f03c918af18afaa8481b591e9001b0 /Command/Proxy.hs
parent8ad7398e29c9bd2ec25274bcca808650778e1457 (diff)
sync: Fix committing when in a direct mode repo that has no HEAD ref.
Seen for example, a newly checked out git submodule. In this case, .git/HEAD is a raw sha, rather than the usual reference to a ref. Removed currentSha in passing, since it was a more roundabout way of doing what headSha does, and headSha is more robust.
Diffstat (limited to 'Command/Proxy.hs')
-rw-r--r--Command/Proxy.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/Proxy.hs b/Command/Proxy.hs
index 59a6bf959..9ccea5796 100644
--- a/Command/Proxy.hs
+++ b/Command/Proxy.hs
@@ -13,8 +13,8 @@ import Config
import Utility.Tmp
import Utility.Env
import Annex.Direct
-import qualified Git.Branch
import qualified Git.Sha
+import qualified Git.Ref
cmd :: [Command]
cmd = [notBareRepo $
@@ -35,7 +35,7 @@ start (c:ps) = liftIO . exitWith =<< ifM isDirect
where
go tmp = do
oldref <- fromMaybe Git.Sha.emptyTree
- <$> inRepo Git.Branch.currentSha
+ <$> inRepo Git.Ref.headSha
exitcode <- liftIO $ proxy tmp
mergeDirectCleanup tmp oldref
return exitcode