diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-16 22:36:35 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-16 22:36:35 -0400 |
commit | da453ba70149444672b8cd64e36fe34604edce73 (patch) | |
tree | d72f9886f8df45795589c37e30b8b9a2947c25ce | |
parent | 19daf3fca40d99dd305a75e10dcaa8fbc734598b (diff) |
bugfix: don't add files under .git-annex
That could happen if git annex add -N were used repeatedly..
-rw-r--r-- | Commands.hs | 5 | ||||
-rw-r--r-- | Core.hs | 2 | ||||
-rw-r--r-- | Locations.hs | 4 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 3 |
4 files changed, 9 insertions, 5 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 @@ -51,7 +51,7 @@ gitAttributes repo = do commit else return () where - attrLine = stateLoc ++ "/*.log merge=union" + attrLine = stateLoc ++ "*.log merge=union" attributes = Git.attributes repo commit = do Git.run repo ["add", attributes] diff --git a/Locations.hs b/Locations.hs index 497850062..76516224c 100644 --- a/Locations.hs +++ b/Locations.hs @@ -18,9 +18,9 @@ import qualified GitRepo as Git {- Long-term, cross-repo state is stored in files inside the .git-annex - directory, in the git repository's working tree. -} -stateLoc = ".git-annex" +stateLoc = ".git-annex/" gitStateDir :: Git.Repo -> FilePath -gitStateDir repo = (Git.workTree repo) ++ "/" ++ stateLoc ++ "/" +gitStateDir repo = (Git.workTree repo) ++ "/" ++ stateLoc {- An annexed file's content is stored in - /path/to/repo/.git/annex/<key>, where <key> is of the form diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index e65ad5b02..50fd28e82 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -51,7 +51,8 @@ Enough broad picture, here's how it actually looks: content again. Use this if you've moved the file around. * `git annex unannex $file` undoes a `git annex add`. But use `git annex drop` if you're just done with a file; only use `unannex` if you - accidentially added a file. + accidentially added a file. (You can also run this on all your annexed + files come the Singularity. ;-) * `git annex describe "some description"` allows associating some description (such as "USB archive drive 1") with a repository. This can help with finding it later, see "Location Tracking" below. |