Skip to content

Commit

Permalink
fixup! Clone repo instead of init + fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-p-marques committed Oct 6, 2021
1 parent a05991e commit 93689c1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions git_aggregator/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,16 @@ def _use_autoshare(self):
def init_repository(self, target_dir):
repository = None
for remote in self.remotes:
# If a target is defined, use it as the base repository
# If not, choose the first merge
if remote["name"] == self.target["remote"]:
repository = remote["url"]
break
elif remote["name"] == self.merges[0]["remote"]:
repository = remote["url"]
# If no target is defined, init an empty repository
branch = self.target["branch"]
if not repository or not branch or branch == "_git_aggregated":
logger.info('Init empty git repository in %s', target_dir)
self.log_call(['git', 'init', target_dir])
return
# If a target is defined, use it as the base repository
logger.info(
'Cloning git repository %s (branch %s) in %s',
repository,
Expand Down

0 comments on commit 93689c1

Please sign in to comment.