diff options
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Proxy.hs | 4 | ||||
-rw-r--r-- | Command/Sync.hs | 18 |
2 files changed, 11 insertions, 11 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 diff --git a/Command/Sync.hs b/Command/Sync.hs index 103f93e32..130693909 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -174,15 +174,15 @@ commitMsg = do return $ "git-annex in " ++ fromMaybe "unknown" (M.lookup u m) commitStaged :: Git.Branch.CommitMode -> String -> Annex Bool -commitStaged commitmode commitmessage = go =<< inRepo Git.Branch.currentUnsafe - where - go Nothing = return False - go (Just branch) = do - runAnnexHook preCommitAnnexHook - parent <- inRepo $ Git.Ref.sha branch - void $ inRepo $ Git.Branch.commit commitmode False commitmessage branch - (maybeToList parent) - return True +commitStaged commitmode commitmessage = do + runAnnexHook preCommitAnnexHook + mb <- inRepo Git.Branch.currentUnsafe + let (getparent, branch) = case mb of + Just b -> (Git.Ref.sha b, b) + Nothing -> (Git.Ref.headSha, Git.Ref.headRef) + parents <- maybeToList <$> inRepo getparent + void $ inRepo $ Git.Branch.commit commitmode False commitmessage branch parents + return True mergeLocal :: Maybe Git.Ref -> CommandStart mergeLocal Nothing = stop |