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 93689c1 commit 94caf15
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions git_aggregator/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,6 @@ def aggregate(self):
self._execute_shell_command_after()
logger.info('End aggregation of %s', self.cwd)

def _use_autoshare(self):
"""Check wether `git-autoshare` is available or not"""
status, result = subprocess.getstatusoutput("git autoshare-clone")
if status == 1:
return False
logger.info("Git autoshare is installed. Taking advantage of it...")
return True

def init_repository(self, target_dir):
repository = None
for remote in self.remotes:
Expand All @@ -218,16 +210,7 @@ def init_repository(self, target_dir):
branch,
target_dir,
)
cmd = ('git',)
if self._use_autoshare():
# Start with a prefetch to update the cache and then clone
logger.info('Updating git-autoshare cache for %s', repository)
self.log_call(['git', 'autoshare-prefetch', repository])
cmd += ('autoshare-clone',)
else:
cmd += ('clone',)
if branch != "_git_aggregated":
cmd += ('-b', branch)
cmd = ('git', 'clone', '-b', branch)
# Emtpy fetch options to use global default for 1st clone
cmd += self._fetch_options({})
cmd += (repository, target_dir)
Expand Down

0 comments on commit 94caf15

Please sign in to comment.