use Branch.name instead of hard coding the branch name
authorJoey Hess <joeyh@joeyh.name>
Tue, 15 Sep 2020 19:44:37 +0000 (15:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 15 Sep 2020 19:47:22 +0000 (15:47 -0400)
Makes much more clear why ActionItemOther is being passed "git-annex".

Command/Commit.hs
Command/Forget.hs
Command/Merge.hs

index 8e9d3bff9c4e10484d1377b1d9ec28e0f0482a3d..1175a0d52e03f5c721e0fe1996cab6ea41a2b737 100644 (file)
@@ -10,6 +10,7 @@ module Command.Commit where
 import Command
 import qualified Annex.Branch
 import qualified Git
+import Git.Types
 
 cmd :: Command
 cmd = command "commit" SectionPlumbing 
@@ -20,10 +21,12 @@ seek :: CmdParams -> CommandSeek
 seek = withNothing (commandAction start)
 
 start :: CommandStart
-start = starting "commit" (ActionItemOther (Just "git-annex")) (SeekInput []) $ do
-               Annex.Branch.commit =<< Annex.Branch.commitMessage
-               _ <- runhook <=< inRepo $ Git.hookPath "annex-content"
-               next $ return True
+start = starting "commit" ai si $ do
+       Annex.Branch.commit =<< Annex.Branch.commitMessage
+       _ <- runhook <=< inRepo $ Git.hookPath "annex-content"
+       next $ return True
   where
        runhook (Just hook) = liftIO $ boolSystem hook []
        runhook Nothing = return True
+       ai = ActionItemOther (Just (fromRef Annex.Branch.name))
+       si = SeekInput []
index 2068f2e44e5d75f9a098d203471068036b67ed80..85acb60e2a80aac6a19ada80bb0650a9782ec103 100644 (file)
@@ -12,6 +12,7 @@ import qualified Annex.Branch as Branch
 import Logs.Transitions
 import qualified Annex
 import Annex.VectorClock
+import Git.Types
 
 cmd :: Command
 cmd = command "forget" SectionMaintenance 
@@ -41,7 +42,7 @@ start o = starting "forget" ai si $ do
                else basets
        perform ts =<< Annex.getState Annex.force
   where
-       ai = ActionItemOther (Just "git-annex")
+       ai = ActionItemOther (Just (fromRef Branch.name))
        si = SeekInput []
 
 perform :: Transitions -> Bool -> CommandPerform
index 285a6febb025aca6eb2480952f3f36994d4fbd90..2b5a6b2c8d7a3e1687adbc2b764f0a60c422c3ac 100644 (file)
@@ -13,6 +13,7 @@ import qualified Git
 import qualified Git.Branch
 import Annex.CurrentBranch
 import Command.Sync (prepMerge, mergeLocal, mergeConfig, merge, SyncOptions(..))
+import Git.Types
 
 cmd :: Command
 cmd = command "merge" SectionMaintenance
@@ -35,7 +36,7 @@ mergeAnnexBranch = starting "merge" ai si $ do
        Annex.Branch.commit =<< Annex.Branch.commitMessage
        next $ return True
   where
-       ai = ActionItemOther (Just "git-annex")
+       ai = ActionItemOther (Just (fromRef Annex.Branch.name))
        si = SeekInput []
 
 mergeSyncedBranch :: CommandStart