aboutsummaryrefslogtreecommitdiff
path: root/Commands.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-16 22:36:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-16 22:36:35 -0400
commitda453ba70149444672b8cd64e36fe34604edce73 (patch)
treed72f9886f8df45795589c37e30b8b9a2947c25ce /Commands.hs
parent19daf3fca40d99dd305a75e10dcaa8fbc734598b (diff)
bugfix: don't add files under .git-annex
That could happen if git annex add -N were used repeatedly..
Diffstat (limited to 'Commands.hs')
-rw-r--r--Commands.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Commands.hs b/Commands.hs
index af6b5aad7..1364a1b35 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -54,7 +54,10 @@ options = [
findWanted :: CmdWants -> [String] -> Git.Repo -> IO [String]
findWanted FilesNotInGit params repo = do
files <- mapM (Git.notInRepo repo) params
- return $ foldl (++) [] files
+ return $ filter notstate $ foldl (++) [] files
+ where
+ -- never include files in the state directory
+ notstate f = f /= take (length stateLoc) f
findWanted FilesInGit params repo = do
files <- mapM (Git.inRepo repo) params
return $ foldl (++) [] files