avoid pre-commit in direct mode
It was a no-op until my recent change that made lookupFile work in direct mode.
This commit is contained in:
parent
1cdf2b923d
commit
20fafc6a2d
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ import Common.Annex
|
||||||
import Command
|
import Command
|
||||||
import qualified Command.Add
|
import qualified Command.Add
|
||||||
import qualified Command.Fix
|
import qualified Command.Fix
|
||||||
|
import Config
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [command "pre-commit" paramPaths seek "run by git pre-commit hook"]
|
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. -}
|
- And, it needs to inject unlocked files into the annex. -}
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek =
|
seek =
|
||||||
[ withFilesToBeCommitted $ whenAnnexed Command.Fix.start
|
[ withFilesToBeCommitted $ whenNotDirect $ whenAnnexed $ Command.Fix.start
|
||||||
, withFilesUnlockedToBeCommitted start]
|
, withFilesUnlockedToBeCommitted start]
|
||||||
|
|
||||||
|
whenNotDirect :: (FilePath -> Annex (Maybe CommandPerform)) -> FilePath -> Annex (Maybe CommandPerform)
|
||||||
|
whenNotDirect a f = ifM isDirect ( stop , a f )
|
||||||
|
|
||||||
start :: FilePath -> CommandStart
|
start :: FilePath -> CommandStart
|
||||||
start file = next $ perform file
|
start file = next $ perform file
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue