optimize pre-commit in direct mode
This commit is contained in:
parent
7888b38e3e
commit
f12202f771
2 changed files with 5 additions and 5 deletions
|
@ -11,7 +11,6 @@ import Common.Annex
|
|||
import Command
|
||||
import qualified Command.Add
|
||||
import qualified Command.Fix
|
||||
import Config
|
||||
|
||||
def :: [Command]
|
||||
def = [command "pre-commit" paramPaths seek "run by git pre-commit hook"]
|
||||
|
@ -20,12 +19,9 @@ def = [command "pre-commit" paramPaths seek "run by git pre-commit hook"]
|
|||
- And, it needs to inject unlocked files into the annex. -}
|
||||
seek :: [CommandSeek]
|
||||
seek =
|
||||
[ withFilesToBeCommitted $ whenNotDirect $ whenAnnexed $ Command.Fix.start
|
||||
[ whenNotDirect $ withFilesToBeCommitted $ whenAnnexed $ Command.Fix.start
|
||||
, withFilesUnlockedToBeCommitted start]
|
||||
|
||||
whenNotDirect :: (FilePath -> Annex (Maybe CommandPerform)) -> FilePath -> Annex (Maybe CommandPerform)
|
||||
whenNotDirect a f = ifM isDirect ( stop , a f )
|
||||
|
||||
start :: FilePath -> CommandStart
|
||||
start file = next $ perform file
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue