map: Fix a failure to detect a loop when both repositories are local and refer to each other with relative paths.
This commit is contained in:
		
					parent
					
						
							
								58567045b7
							
						
					
				
			
			
				commit
				
					
						b6c8a0119a
					
				
			
		
					 2 changed files with 12 additions and 4 deletions
				
			
		| 
						 | 
					@ -138,15 +138,16 @@ spider' (r:rs) known
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		-- The remotes will be relative to r', and need to be
 | 
							-- The remotes will be relative to r', and need to be
 | 
				
			||||||
		-- made absolute for later use.
 | 
							-- 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
 | 
							let r'' = Git.remotesAdd r' remotes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spider' (rs ++ remotes) (r'':known)
 | 
							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
 | 
					absRepo reference r
 | 
				
			||||||
	| Git.repoIsUrl reference = Git.localToUrl reference r
 | 
						| Git.repoIsUrl reference = return $ Git.localToUrl reference r
 | 
				
			||||||
	| otherwise = r
 | 
						| otherwise = liftIO $ Git.repoFromAbsPath =<< absPath (Git.workTree r)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{- Checks if two repos are the same. -}
 | 
					{- Checks if two repos are the same. -}
 | 
				
			||||||
same :: Git.Repo -> Git.Repo -> Bool
 | 
					same :: Git.Repo -> Git.Repo -> Bool
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										7
									
								
								debian/changelog
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								debian/changelog
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,3 +1,10 @@
 | 
				
			||||||
 | 
					git-annex (3.20111204) UNRELEASED; urgency=low
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  * map: Fix a failure to detect a loop when both repositories are local
 | 
				
			||||||
 | 
					    and refer to each other with relative paths.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 -- Joey Hess <joeyh@debian.org>  Sun, 04 Dec 2011 12:22:37 -0400
 | 
				
			||||||
 | 
					
 | 
				
			||||||
git-annex (3.20111203) unstable; urgency=low
 | 
					git-annex (3.20111203) unstable; urgency=low
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  * The VFAT filesystem on recent versions of Linux, when mounted with
 | 
					  * The VFAT filesystem on recent versions of Linux, when mounted with
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue