Show More
@@ -118,6 +118,15 b' class GitRemote(object):' | |||||
118 | repo = self._factory.repo(wire) |
|
118 | repo = self._factory.repo(wire) | |
119 | repo[ref] = commit_id |
|
119 | repo[ref] = commit_id | |
120 |
|
120 | |||
|
121 | def _remote_conf(self, config): | |||
|
122 | params = [ | |||
|
123 | '-c', 'core.askpass=""', | |||
|
124 | ] | |||
|
125 | ssl_cert_dir = config.get('vcs_ssl_dir') | |||
|
126 | if ssl_cert_dir: | |||
|
127 | params.extend(['-c', 'http.sslCAinfo={}'.format(ssl_cert_dir)]) | |||
|
128 | return params | |||
|
129 | ||||
121 | @reraise_safe_exceptions |
|
130 | @reraise_safe_exceptions | |
122 | def add_object(self, wire, content): |
|
131 | def add_object(self, wire, content): | |
123 | repo = self._factory.repo(wire) |
|
132 | repo = self._factory.repo(wire) | |
@@ -456,11 +465,11 b' class GitRemote(object):' | |||||
456 | repo = self._factory.repo(wire) |
|
465 | repo = self._factory.repo(wire) | |
457 | if refs and not isinstance(refs, (list, tuple)): |
|
466 | if refs and not isinstance(refs, (list, tuple)): | |
458 | refs = [refs] |
|
467 | refs = [refs] | |
459 |
|
468 | config = self._wire_to_config(wire) | ||
460 | # get all remote refs we'll use to fetch later |
|
469 | # get all remote refs we'll use to fetch later | |
461 | output, __ = self.run_git_command( |
|
470 | output, __ = self.run_git_command( | |
462 | wire, ['ls-remote', url], fail_on_stderr=False, |
|
471 | wire, ['ls-remote', url], fail_on_stderr=False, | |
463 | _copts=['-c', 'core.askpass=""'], |
|
472 | _copts=self._remote_conf(config), | |
464 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) |
|
473 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) | |
465 |
|
474 | |||
466 | remote_refs = collections.OrderedDict() |
|
475 | remote_refs = collections.OrderedDict() | |
@@ -491,7 +500,7 b' class GitRemote(object):' | |||||
491 | _out, _err = self.run_git_command( |
|
500 | _out, _err = self.run_git_command( | |
492 | wire, ['fetch', url, '--force', '--prune', '--'] + fetch_refs, |
|
501 | wire, ['fetch', url, '--force', '--prune', '--'] + fetch_refs, | |
493 | fail_on_stderr=False, |
|
502 | fail_on_stderr=False, | |
494 | _copts=['-c', 'core.askpass=""'], |
|
503 | _copts=self._remote_conf(config), | |
495 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) |
|
504 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) | |
496 |
|
505 | |||
497 | return remote_refs |
|
506 | return remote_refs | |
@@ -500,11 +509,11 b' class GitRemote(object):' | |||||
500 | def sync_push(self, wire, url, refs=None): |
|
509 | def sync_push(self, wire, url, refs=None): | |
501 | if not self.check_url(url, wire): |
|
510 | if not self.check_url(url, wire): | |
502 | return |
|
511 | return | |
503 |
|
512 | config = self._wire_to_config(wire) | ||
504 | repo = self._factory.repo(wire) |
|
513 | repo = self._factory.repo(wire) | |
505 | self.run_git_command( |
|
514 | self.run_git_command( | |
506 | wire, ['push', url, '--mirror'], fail_on_stderr=False, |
|
515 | wire, ['push', url, '--mirror'], fail_on_stderr=False, | |
507 | _copts=['-c', 'core.askpass=""'], |
|
516 | _copts=self._remote_conf(config), | |
508 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) |
|
517 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) | |
509 |
|
518 | |||
510 | @reraise_safe_exceptions |
|
519 | @reraise_safe_exceptions |
General Comments 0
You need to be logged in to leave comments.
Login now