config: call Repo.factory only in one place
This patch simplifies the code a bit and does not change any semantics. Signed-off-by: Henning Schild <henning.schild@siemens.com>
This commit is contained in:
committed by
Daniel Wagner
parent
3594ad50a0
commit
9da82dba13
@@ -189,6 +189,7 @@ class Config:
|
||||
name = repo_config_dict[repo].get('name', repo)
|
||||
refspec = repo_config_dict[repo].get('refspec', None)
|
||||
path = repo_config_dict[repo].get('path', None)
|
||||
dis_ops = False
|
||||
|
||||
if url is None:
|
||||
# No git operation on repository
|
||||
@@ -199,12 +200,12 @@ class Config:
|
||||
name)
|
||||
|
||||
url = path
|
||||
rep = Repo.factory(url=url, path=path, layers=layers)
|
||||
rep.disable_operations()
|
||||
dis_ops = True
|
||||
else:
|
||||
path = path or os.path.join(self.kas_work_dir, name)
|
||||
rep = Repo.factory(url=url, path=path, refspec=refspec,
|
||||
layers=layers)
|
||||
|
||||
rep = Repo.factory(url=url, path=path, refspec=refspec,
|
||||
layers=layers, disable_operations=dis_ops)
|
||||
repo_dict[repo] = rep
|
||||
return repo_dict
|
||||
|
||||
|
Reference in New Issue
Block a user