diff options
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/git_config.py b/git_config.py index 6b47456f..13fbda24 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -104,8 +104,8 @@ class GitConfig(object): | |||
104 | self._json = jsonFile | 104 | self._json = jsonFile |
105 | if self._json is None: | 105 | if self._json is None: |
106 | self._json = os.path.join( | 106 | self._json = os.path.join( |
107 | os.path.dirname(self.file), | 107 | os.path.dirname(self.file), |
108 | '.repo_' + os.path.basename(self.file) + '.json') | 108 | '.repo_' + os.path.basename(self.file) + '.json') |
109 | 109 | ||
110 | def Has(self, name, include_defaults=True): | 110 | def Has(self, name, include_defaults=True): |
111 | """Return true if this configuration file has the key. | 111 | """Return true if this configuration file has the key. |
@@ -269,7 +269,7 @@ class GitConfig(object): | |||
269 | def _ReadJson(self): | 269 | def _ReadJson(self): |
270 | try: | 270 | try: |
271 | if os.path.getmtime(self._json) \ | 271 | if os.path.getmtime(self._json) \ |
272 | <= os.path.getmtime(self.file): | 272 | <= os.path.getmtime(self.file): |
273 | platform_utils.remove(self._json) | 273 | platform_utils.remove(self._json) |
274 | return None | 274 | return None |
275 | except OSError: | 275 | except OSError: |
@@ -422,16 +422,16 @@ def _open_ssh(host, port=None): | |||
422 | return True | 422 | return True |
423 | 423 | ||
424 | if not _ssh_master \ | 424 | if not _ssh_master \ |
425 | or 'GIT_SSH' in os.environ \ | 425 | or 'GIT_SSH' in os.environ \ |
426 | or sys.platform in ('win32', 'cygwin'): | 426 | or sys.platform in ('win32', 'cygwin'): |
427 | # failed earlier, or cygwin ssh can't do this | 427 | # failed earlier, or cygwin ssh can't do this |
428 | # | 428 | # |
429 | return False | 429 | return False |
430 | 430 | ||
431 | # We will make two calls to ssh; this is the common part of both calls. | 431 | # We will make two calls to ssh; this is the common part of both calls. |
432 | command_base = ['ssh', | 432 | command_base = ['ssh', |
433 | '-o', 'ControlPath %s' % ssh_sock(), | 433 | '-o', 'ControlPath %s' % ssh_sock(), |
434 | host] | 434 | host] |
435 | if port is not None: | 435 | if port is not None: |
436 | command_base[1:1] = ['-p', str(port)] | 436 | command_base[1:1] = ['-p', str(port)] |
437 | 437 | ||
@@ -465,7 +465,7 @@ def _open_ssh(host, port=None): | |||
465 | except Exception as e: | 465 | except Exception as e: |
466 | _ssh_master = False | 466 | _ssh_master = False |
467 | print('\nwarn: cannot enable ssh control master for %s:%s\n%s' | 467 | print('\nwarn: cannot enable ssh control master for %s:%s\n%s' |
468 | % (host, port, str(e)), file=sys.stderr) | 468 | % (host, port, str(e)), file=sys.stderr) |
469 | return False | 469 | return False |
470 | 470 | ||
471 | time.sleep(1) | 471 | time.sleep(1) |
@@ -583,7 +583,7 @@ class Remote(object): | |||
583 | self.review = self._Get('review') | 583 | self.review = self._Get('review') |
584 | self.projectname = self._Get('projectname') | 584 | self.projectname = self._Get('projectname') |
585 | self.fetch = list(map(RefSpec.FromString, | 585 | self.fetch = list(map(RefSpec.FromString, |
586 | self._Get('fetch', all_keys=True))) | 586 | self._Get('fetch', all_keys=True))) |
587 | self._review_url = None | 587 | self._review_url = None |
588 | 588 | ||
589 | def _InsteadOf(self): | 589 | def _InsteadOf(self): |
@@ -598,7 +598,7 @@ class Remote(object): | |||
598 | 598 | ||
599 | for insteadOf in insteadOfList: | 599 | for insteadOf in insteadOfList: |
600 | if self.url.startswith(insteadOf) \ | 600 | if self.url.startswith(insteadOf) \ |
601 | and len(insteadOf) > len(longest): | 601 | and len(insteadOf) > len(longest): |
602 | longest = insteadOf | 602 | longest = insteadOf |
603 | longestUrl = url | 603 | longestUrl = url |
604 | 604 | ||