diff options
Diffstat (limited to 'Command/Add.hs')
-rw-r--r-- | Command/Add.hs | 11 |
1 files changed, 8 insertions, 3 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 |