bugfix: don't add files under .git-annex

That could happen if git annex add -N were used repeatedly..
This commit is contained in:
Joey Hess 2010-10-16 22:36:35 -04:00
parent 19daf3fca4
commit da453ba701
4 changed files with 9 additions and 5 deletions

View file

@ -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