Show More
@@ -461,10 +461,18 b' class GitRemote(RemoteBase):' | |||
|
461 | 461 | url_obj = url_parser(safe_bytes(url)) |
|
462 | 462 | authinfo = url_obj.authinfo()[1] |
|
463 | 463 | |
|
464 | def _convert_to_strings(data): | |
|
465 | if isinstance(data, bytes): | |
|
466 | return safe_str(data) | |
|
467 | elif isinstance(data, tuple): | |
|
468 | return tuple(_convert_to_strings(item) for item in data) | |
|
469 | else: | |
|
470 | return data | |
|
471 | ||
|
464 | 472 | if authinfo: |
|
465 | 473 | # create a password manager |
|
466 | 474 | passmgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() |
|
467 | passmgr.add_password(*authinfo) | |
|
475 | passmgr.add_password(*_convert_to_strings(authinfo)) | |
|
468 | 476 | |
|
469 | 477 | handlers.extend((httpbasicauthhandler(passmgr), |
|
470 | 478 | httpdigestauthhandler(passmgr))) |
@@ -483,7 +491,7 b' class GitRemote(RemoteBase):' | |||
|
483 | 491 | if not test_uri.endswith('info/refs'): |
|
484 | 492 | test_uri = test_uri.rstrip('/') + '/info/refs' |
|
485 | 493 | |
|
486 |
o = self._build_opener( |
|
|
494 | o = self._build_opener(url=url) | |
|
487 | 495 | o.addheaders = [('User-Agent', 'git/1.7.8.0')] # fake some git |
|
488 | 496 | |
|
489 | 497 | q = {"service": 'git-upload-pack'} |
@@ -821,7 +829,7 b' class GitRemote(RemoteBase):' | |||
|
821 | 829 | return remote_refs |
|
822 | 830 | |
|
823 | 831 | @reraise_safe_exceptions |
|
824 | def sync_push(self, wire, url, refs=None): | |
|
832 | def sync_push(self, wire, url, refs=None, **kwargs): | |
|
825 | 833 | if not self.check_url(url, wire): |
|
826 | 834 | return |
|
827 | 835 | config = self._wire_to_config(wire) |
@@ -830,6 +838,12 b' class GitRemote(RemoteBase):' | |||
|
830 | 838 | wire, ['push', url, '--mirror'], fail_on_stderr=False, |
|
831 | 839 | _copts=self._remote_conf(config), |
|
832 | 840 | extra_env={'GIT_TERMINAL_PROMPT': '0'}) |
|
841 | if kwargs.get('sync_large_objects'): | |
|
842 | self.run_git_command( | |
|
843 | wire, ['lfs', 'push', url, '--all'], | |
|
844 | fail_on_stderr=False, | |
|
845 | _copts=self._remote_conf(config), | |
|
846 | ) | |
|
833 | 847 | |
|
834 | 848 | @reraise_safe_exceptions |
|
835 | 849 | def get_remote_refs(self, wire, url): |
General Comments 0
You need to be logged in to leave comments.
Login now