From 16a5c3ac51a5967669d0341d2ae58b1362d7469f Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 12 Feb 2020 15:54:26 +0900 Subject: [PATCH] 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 Tested-by: David Pursehouse --- git_config.py | 13 ++++++------- 1 file 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): def _ReadJson(self): try: - if os.path.getmtime(self._json) \ - <= os.path.getmtime(self.file): + if os.path.getmtime(self._json) <= os.path.getmtime(self.file): platform_utils.remove(self._json) return None except OSError: @@ -429,9 +428,9 @@ def _open_ssh(host, port=None): if key in _master_keys: return True - if not _ssh_master \ - or 'GIT_SSH' in os.environ \ - or sys.platform in ('win32', 'cygwin'): + if (not _ssh_master + or 'GIT_SSH' in os.environ + or sys.platform in ('win32', 'cygwin')): # failed earlier, or cygwin ssh can't do this # return False @@ -612,8 +611,8 @@ class Remote(object): insteadOfList = globCfg.GetString(key, all_keys=True) for insteadOf in insteadOfList: - if self.url.startswith(insteadOf) \ - and len(insteadOf) > len(longest): + if (self.url.startswith(insteadOf) + and len(insteadOf) > len(longest)): longest = insteadOf longestUrl = url