From 9c9d97b094b32e36dd0c7a86329adea830267453 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Jan 2013 16:06:20 -0400 Subject: avoid pre-commit in direct mode It was a no-op until my recent change that made lookupFile work in direct mode. --- Command/PreCommit.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Command/PreCommit.hs') 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 -- cgit v1.2.3