summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-26 14:52:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-26 14:52:07 -0400
commit0937413b678c9c4d04d0d69bf9ba673a8a0f7ab3 (patch)
treed2660d274d534a0ca9eacf5d9b905527b86b0e4e /Command
parent19bf29a0bce26eb60dcf2480967e0a3088afac67 (diff)
add --include-dotfiles: New option, perhaps useful for backups.
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs11
-rw-r--r--Command/Uninit.hs2
2 files changed, 9 insertions, 4 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 0c8e2a48d..f9e2b3342 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -34,8 +34,12 @@ import Annex.ReplaceFile
import Utility.Tmp
def :: [Command]
-def = [notBareRepo $ command "add" paramPaths seek SectionCommon
- "add files to annex"]
+def = [notBareRepo $ withOptions [includeDotFilesOption] $
+ command "add" paramPaths seek SectionCommon
+ "add files to annex"]
+
+includeDotFilesOption :: Option
+includeDotFilesOption = flagOption [] "include-dotfiles" "don't skip dotfiles"
{- Add acts on both files not checked into git yet, and unlocked files.
-
@@ -47,7 +51,8 @@ seek ps = do
( start file
, stop
)
- go withFilesNotInGit
+ skipdotfiles <- not <$> Annex.getFlag (optionName includeDotFilesOption)
+ go $ withFilesNotInGit skipdotfiles
ifM isDirect
( go withFilesMaybeModified
, go withFilesUnlocked
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index 2a9e3e687..5b2adf0bd 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -36,7 +36,7 @@ check = do
seek :: CommandSeek
seek ps = do
- withFilesNotInGit (whenAnnexed startCheckIncomplete) ps
+ withFilesNotInGit False (whenAnnexed startCheckIncomplete) ps
withFilesInGit (whenAnnexed Command.Unannex.start) ps
finish