move commitStaged out of Command.Sync which no longer uses it

It's trivial enough that it it's not worth factoring it out to somewhere
in common with Command.Undo and the assistant.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
Joey Hess 2024-02-07 16:19:28 -04:00
parent 21123ba368
commit fa9197560d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 16 additions and 13 deletions

View file

@ -40,6 +40,7 @@ import qualified Database.Keys
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
@ -240,7 +241,11 @@ commitStaged msg = do
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