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>
This commit is contained in:
David Pursehouse 2020-02-12 15:54:26 +09:00
parent 145e35b805
commit 16a5c3ac51

View File

@ -274,8 +274,7 @@ class GitConfig(object):
def _ReadJson(self): def _ReadJson(self):
try: try:
if os.path.getmtime(self._json) \ if os.path.getmtime(self._json) <= os.path.getmtime(self.file):
<= os.path.getmtime(self.file):
platform_utils.remove(self._json) platform_utils.remove(self._json)
return None return None
except OSError: except OSError:
@ -429,9 +428,9 @@ def _open_ssh(host, port=None):
if key in _master_keys: if key in _master_keys:
return True return True
if not _ssh_master \ if (not _ssh_master
or 'GIT_SSH' in os.environ \ or 'GIT_SSH' in os.environ
or sys.platform in ('win32', 'cygwin'): or sys.platform in ('win32', 'cygwin')):
# failed earlier, or cygwin ssh can't do this # failed earlier, or cygwin ssh can't do this
# #
return False return False
@ -612,8 +611,8 @@ class Remote(object):
insteadOfList = globCfg.GetString(key, all_keys=True) insteadOfList = globCfg.GetString(key, all_keys=True)
for insteadOf in insteadOfList: for insteadOf in insteadOfList:
if self.url.startswith(insteadOf) \ if (self.url.startswith(insteadOf)
and len(insteadOf) > len(longest): and len(insteadOf) > len(longest)):
longest = insteadOf longest = insteadOf
longestUrl = url longestUrl = url