repos: introduce a factory to abstract away from Repo implementation
The user just calls that factory and gets something that is a Repo, in fact just a GitRepo for now. Signed-off-by: Henning Schild <henning.schild@siemens.com>
This commit is contained in:
		
				
					committed by
					
						
						Daniel Wagner
					
				
			
			
				
	
			
			
			
						parent
						
							b5b2766b24
						
					
				
				
					commit
					3594ad50a0
				
			@@ -199,16 +199,12 @@ class Config:
 | 
			
		||||
                                 name)
 | 
			
		||||
 | 
			
		||||
                url = path
 | 
			
		||||
                rep = Repo(url=url,
 | 
			
		||||
                           path=path,
 | 
			
		||||
                           layers=layers)
 | 
			
		||||
                rep = Repo.factory(url=url, path=path, layers=layers)
 | 
			
		||||
                rep.disable_operations()
 | 
			
		||||
            else:
 | 
			
		||||
                path = path or os.path.join(self.kas_work_dir, name)
 | 
			
		||||
                rep = Repo(url=url,
 | 
			
		||||
                           path=path,
 | 
			
		||||
                           refspec=refspec,
 | 
			
		||||
                           layers=layers)
 | 
			
		||||
                rep = Repo.factory(url=url, path=path, refspec=refspec,
 | 
			
		||||
                                   layers=layers)
 | 
			
		||||
            repo_dict[repo] = rep
 | 
			
		||||
        return repo_dict
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user