aboutsummaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-29 11:42:00 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-29 11:42:00 -0400
commitb3aaf980e460c2287fc1ef2b262685b1879e6ed0 (patch)
treef7f02ff6350cbf7f4470c696b5a6366c88350fa5 /Command/Add.hs
parentfb7663ceb86b309dd223ebc113c8b586955a0e03 (diff)
--force will cause add, etc, to operate on ignored files.
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 29a1518e8..5133ee1fd 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -11,6 +11,7 @@ import Control.Monad.State (liftIO)
import System.Posix.Files
import Command
+import qualified Annex
import qualified AnnexQueue
import qualified Backend
import LocationLog
@@ -60,5 +61,8 @@ cleanup file key = do
let mtime = modificationTime s
liftIO $ touch file (TimeSpec mtime) False
- AnnexQueue.add "add" [Param "--"] file
+ force <- Annex.getState Annex.force
+ if force
+ then AnnexQueue.add "add" [Param "-f", Param "--"] file
+ else AnnexQueue.add "add" [Param "--"] file
return True