From 15ffb8b60e26bd8707c132f2452cb4adbe7e6d02 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 4 Mar 2015 15:25:13 -0400 Subject: 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. --- Command/Proxy.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Command/Proxy.hs') 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 -- cgit v1.2.3