use Branch.name instead of hard coding the branch name
Makes much more clear why ActionItemOther is being passed "git-annex".
This commit is contained in:
parent
3a05d53761
commit
2a3c2b1843
3 changed files with 11 additions and 6 deletions
|
@ -10,6 +10,7 @@ module Command.Commit where
|
||||||
import Command
|
import Command
|
||||||
import qualified Annex.Branch
|
import qualified Annex.Branch
|
||||||
import qualified Git
|
import qualified Git
|
||||||
|
import Git.Types
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = command "commit" SectionPlumbing
|
cmd = command "commit" SectionPlumbing
|
||||||
|
@ -20,10 +21,12 @@ seek :: CmdParams -> CommandSeek
|
||||||
seek = withNothing (commandAction start)
|
seek = withNothing (commandAction start)
|
||||||
|
|
||||||
start :: CommandStart
|
start :: CommandStart
|
||||||
start = starting "commit" (ActionItemOther (Just "git-annex")) (SeekInput []) $ do
|
start = starting "commit" ai si $ do
|
||||||
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
||||||
_ <- runhook <=< inRepo $ Git.hookPath "annex-content"
|
_ <- runhook <=< inRepo $ Git.hookPath "annex-content"
|
||||||
next $ return True
|
next $ return True
|
||||||
where
|
where
|
||||||
runhook (Just hook) = liftIO $ boolSystem hook []
|
runhook (Just hook) = liftIO $ boolSystem hook []
|
||||||
runhook Nothing = return True
|
runhook Nothing = return True
|
||||||
|
ai = ActionItemOther (Just (fromRef Annex.Branch.name))
|
||||||
|
si = SeekInput []
|
||||||
|
|
|
@ -12,6 +12,7 @@ import qualified Annex.Branch as Branch
|
||||||
import Logs.Transitions
|
import Logs.Transitions
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import Annex.VectorClock
|
import Annex.VectorClock
|
||||||
|
import Git.Types
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = command "forget" SectionMaintenance
|
cmd = command "forget" SectionMaintenance
|
||||||
|
@ -41,7 +42,7 @@ start o = starting "forget" ai si $ do
|
||||||
else basets
|
else basets
|
||||||
perform ts =<< Annex.getState Annex.force
|
perform ts =<< Annex.getState Annex.force
|
||||||
where
|
where
|
||||||
ai = ActionItemOther (Just "git-annex")
|
ai = ActionItemOther (Just (fromRef Branch.name))
|
||||||
si = SeekInput []
|
si = SeekInput []
|
||||||
|
|
||||||
perform :: Transitions -> Bool -> CommandPerform
|
perform :: Transitions -> Bool -> CommandPerform
|
||||||
|
|
|
@ -13,6 +13,7 @@ import qualified Git
|
||||||
import qualified Git.Branch
|
import qualified Git.Branch
|
||||||
import Annex.CurrentBranch
|
import Annex.CurrentBranch
|
||||||
import Command.Sync (prepMerge, mergeLocal, mergeConfig, merge, SyncOptions(..))
|
import Command.Sync (prepMerge, mergeLocal, mergeConfig, merge, SyncOptions(..))
|
||||||
|
import Git.Types
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = command "merge" SectionMaintenance
|
cmd = command "merge" SectionMaintenance
|
||||||
|
@ -35,7 +36,7 @@ mergeAnnexBranch = starting "merge" ai si $ do
|
||||||
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
||||||
next $ return True
|
next $ return True
|
||||||
where
|
where
|
||||||
ai = ActionItemOther (Just "git-annex")
|
ai = ActionItemOther (Just (fromRef Annex.Branch.name))
|
||||||
si = SeekInput []
|
si = SeekInput []
|
||||||
|
|
||||||
mergeSyncedBranch :: CommandStart
|
mergeSyncedBranch :: CommandStart
|
||||||
|
|
Loading…
Reference in a new issue