diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-04 12:23:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-04 12:23:10 -0400 |
commit | b6c8a0119ad68f466e24ec2bab3a2bacf6ea726e (patch) | |
tree | 16322abcb1011801f7b0b1e2ce4f524a585f9bf3 /Command | |
parent | 58567045b737d1ffbcd143934a85e22e62da8044 (diff) |
map: Fix a failure to detect a loop when both repositories are local and refer to each other with relative paths.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Map.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Command/Map.hs b/Command/Map.hs index 8755bc7c2..6b1e8d5bb 100644 --- a/Command/Map.hs +++ b/Command/Map.hs @@ -138,15 +138,16 @@ spider' (r:rs) known -- The remotes will be relative to r', and need to be -- made absolute for later use. - let remotes = map (absRepo r') (Git.remotes r') + remotes <- mapM (absRepo r') (Git.remotes r') let r'' = Git.remotesAdd r' remotes spider' (rs ++ remotes) (r'':known) -absRepo :: Git.Repo -> Git.Repo -> Git.Repo +{- Converts repos to a common absolute form. -} +absRepo :: Git.Repo -> Git.Repo -> Annex Git.Repo absRepo reference r - | Git.repoIsUrl reference = Git.localToUrl reference r - | otherwise = r + | Git.repoIsUrl reference = return $ Git.localToUrl reference r + | otherwise = liftIO $ Git.repoFromAbsPath =<< absPath (Git.workTree r) {- Checks if two repos are the same. -} same :: Git.Repo -> Git.Repo -> Bool |