diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-19 12:44:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-19 12:44:24 -0400 |
commit | 67cc72d540d8dd03f433a135297ba86d896ba14d (patch) | |
tree | 9730d5abcb9b268448eca937a13df88912e06f8e /Annex/Content | |
parent | 20ff17f05aa8f0e553d11e5a3ca714009ce80440 (diff) |
normalise associated files
Sometimes ./file will be passed in, and sometimes file; need to treat these
the same.
Diffstat (limited to 'Annex/Content')
-rw-r--r-- | Annex/Content/Direct.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index 5e33a8951..64182ddc6 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -54,16 +54,18 @@ changeAssociatedFiles key transform = do removeAssociatedFile :: Key -> FilePath -> Annex [FilePath] removeAssociatedFile key file = do - fs <- changeAssociatedFiles key $ filter (/= file) + fs <- changeAssociatedFiles key $ filter (/= normalise file) when (null fs) $ logStatus key InfoMissing return fs addAssociatedFile :: Key -> FilePath -> Annex [FilePath] addAssociatedFile key file = changeAssociatedFiles key $ \files -> - if file `elem` files + if file' `elem` files then files - else file:files + else file':files + where + file' = normalise file {- Checks if a file in the tree, associated with a key, has not been modified. - |