diff options
-rw-r--r-- | Command/PreCommit.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs index 06140fa52..0418229b1 100644 --- a/Command/PreCommit.hs +++ b/Command/PreCommit.hs @@ -11,6 +11,7 @@ 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"] @@ -19,9 +20,12 @@ 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 $ whenAnnexed Command.Fix.start + [ withFilesToBeCommitted $ whenNotDirect $ 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 |