summaryrefslogtreecommitdiff
path: root/Command/PreCommit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-10 23:35:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-10 23:45:14 -0400
commitb327227ba596d4fc5012138d03390c3eb861b808 (patch)
tree921c3ca6851d1ede45c387d9fd54997dcbf44906 /Command/PreCommit.hs
parent4389782628a1cc683ef238e848b6311fc4bd82c3 (diff)
better limiting of start actions to only run whenAnnexed
Mostly only refactoring, but this does remove one redundant stat of the symlink by copy.
Diffstat (limited to 'Command/PreCommit.hs')
-rw-r--r--Command/PreCommit.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index 1949de113..57bc7ac13 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -18,8 +18,9 @@ def = [command "pre-commit" paramPaths seek "run by git pre-commit hook"]
{- The pre-commit hook needs to fix symlinks to all files being committed.
- And, it needs to inject unlocked files into the annex. -}
seek :: [CommandSeek]
-seek = [withFilesToBeCommitted Command.Fix.start,
- withFilesUnlockedToBeCommitted start]
+seek =
+ [ withFilesToBeCommitted $ whenAnnexed Command.Fix.start
+ , withFilesUnlockedToBeCommitted start]
start :: BackendFile -> CommandStart
start p = next $ perform p