summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorDavid Pursehouse <dpursehouse@collab.net>2020-02-12 15:54:26 +0900
committerDavid Pursehouse <dpursehouse@collab.net>2020-02-12 07:29:25 +0000
commit16a5c3ac51a5967669d0341d2ae58b1362d7469f (patch)
treeb65032489af4624da9bd8e98d73e80cb616ed742 /git_config.py
parent145e35b805957487601514481df23b8fb723be38 (diff)
downloadgit-repo-16a5c3ac51a5967669d0341d2ae58b1362d7469f.tar.gz
git_config: Stop using backslash to wrap lines
Unwrap one unnecessarily wrapped line, and use parentheses on a wrapped condition instead of wrapping with backslashes. Change-Id: I12679a0547dd822b15a6551e0f6c308239ff7b2d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254607 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/git_config.py b/git_config.py
index 5fb61d21..054f5c64 100644
--- a/git_config.py
+++ b/git_config.py
@@ -274,8 +274,7 @@ class GitConfig(object):
274 274
275 def _ReadJson(self): 275 def _ReadJson(self):
276 try: 276 try:
277 if os.path.getmtime(self._json) \ 277 if os.path.getmtime(self._json) <= os.path.getmtime(self.file):
278 <= os.path.getmtime(self.file):
279 platform_utils.remove(self._json) 278 platform_utils.remove(self._json)
280 return None 279 return None
281 except OSError: 280 except OSError:
@@ -429,9 +428,9 @@ def _open_ssh(host, port=None):
429 if key in _master_keys: 428 if key in _master_keys:
430 return True 429 return True
431 430
432 if not _ssh_master \ 431 if (not _ssh_master
433 or 'GIT_SSH' in os.environ \ 432 or 'GIT_SSH' in os.environ
434 or sys.platform in ('win32', 'cygwin'): 433 or sys.platform in ('win32', 'cygwin')):
435 # failed earlier, or cygwin ssh can't do this 434 # failed earlier, or cygwin ssh can't do this
436 # 435 #
437 return False 436 return False
@@ -612,8 +611,8 @@ class Remote(object):
612 insteadOfList = globCfg.GetString(key, all_keys=True) 611 insteadOfList = globCfg.GetString(key, all_keys=True)
613 612
614 for insteadOf in insteadOfList: 613 for insteadOf in insteadOfList:
615 if self.url.startswith(insteadOf) \ 614 if (self.url.startswith(insteadOf)
616 and len(insteadOf) > len(longest): 615 and len(insteadOf) > len(longest)):
617 longest = insteadOf 616 longest = insteadOf
618 longestUrl = url 617 longestUrl = url
619 618