##// END OF EJS Templates
git: limit sync-fetch to tags/ and heads/ with default execution arguments
marcink -
r766:7807f9db default
parent child Browse files
Show More
@@ -584,14 +584,19 b' class GitRemote(RemoteBase):'
584 584 return remote_refs
585 585
586 586 @reraise_safe_exceptions
587 def sync_fetch(self, wire, url, refs=None):
587 def sync_fetch(self, wire, url, refs=None, all_refs=False):
588 588 repo = self._factory.repo(wire)
589 589 if refs and not isinstance(refs, (list, tuple)):
590 590 refs = [refs]
591
591 592 config = self._wire_to_config(wire)
592 593 # get all remote refs we'll use to fetch later
594 cmd = ['ls-remote']
595 if not all_refs:
596 cmd += ['--heads', '--tags']
597 cmd += [url]
593 598 output, __ = self.run_git_command(
594 wire, ['ls-remote', url], fail_on_stderr=False,
599 wire, cmd, fail_on_stderr=False,
595 600 _copts=self._remote_conf(config),
596 601 extra_env={'GIT_TERMINAL_PROMPT': '0'})
597 602
@@ -619,6 +624,7 b' class GitRemote(RemoteBase):'
619 624 elif not refs:
620 625 fetch_refs.append('{}:{}'.format(ref, ref))
621 626 log.debug('Finished obtaining fetch refs, total: %s', len(fetch_refs))
627
622 628 if fetch_refs:
623 629 for chunk in more_itertools.chunked(fetch_refs, 1024 * 4):
624 630 fetch_refs_chunks = list(chunk)
General Comments 0
You need to be logged in to leave comments. Login now