import qualified Command.Sync
import qualified Command.Add
import Config.GitConfig
+import qualified Git.Branch
import Utility.Tuple
import Utility.Metered
import qualified Utility.RawFilePath as R
Left _ -> return False
Right _ -> do
cmode <- annexCommitMode <$> Annex.getGitConfig
- ok <- Command.Sync.commitStaged cmode msg
+ ok <- inRepo $ Git.Branch.commitCommand cmode
+ (Git.Branch.CommitQuiet True)
+ [ Param "-m"
+ , Param msg
+ ]
when ok $
Command.Sync.updateBranches =<< getCurrentBranch
return ok
prepMerge,
mergeLocal,
mergeRemote,
- commitStaged,
commitMsg,
pushBranch,
updateBranch,
m <- uuidDescMap
return $ "git-annex in " ++ maybe "unknown" fromUUIDDesc (M.lookup u m)
-commitStaged :: Git.Branch.CommitMode -> String -> Annex Bool
-commitStaged commitmode commitmessage =
- inRepo $ Git.Branch.commitCommand commitmode
- (Git.Branch.CommitQuiet True)
- [ Param "-m"
- , Param commitmessage
- ]
-
mergeLocal :: [Git.Merge.MergeConfig] -> SyncOptions -> CurrBranch -> CommandStart
mergeLocal mergeconfig o currbranch = stopUnless (notOnlyAnnex o) $
mergeLocal' mergeconfig o currbranch
{- git-annex command
-
- - Copyright 2014 Joey Hess <id@joeyh.name>
+ - Copyright 2014-2024 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
import qualified Git.LsFiles as LsFiles
import qualified Git.Command as Git
import qualified Git.Branch
-import qualified Command.Sync
import qualified Utility.RawFilePath as R
cmd :: Command
-- Committing staged changes before undo allows later
-- undoing the undo. It would be nicer to only commit staged
-- changes to the specified files, rather than all staged changes.
- void $ Command.Sync.commitStaged Git.Branch.ManualCommit
+ void $ commitStaged Git.Branch.ManualCommit
"commit before undo"
withStrings (commandAction . start) ps
inRepo $ Git.run [Param "checkout", Param "--", File f]
next $ liftIO cleanup
+
+commitStaged :: Git.Branch.CommitMode -> String -> Annex Bool
+commitStaged commitmode commitmessage =
+ inRepo $ Git.Branch.commitCommand commitmode
+ (Git.Branch.CommitQuiet True)
+ [ Param "-m"
+ , Param commitmessage
+ ]