diff options
Diffstat (limited to 'git_command.py')
-rw-r--r-- | git_command.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/git_command.py b/git_command.py index 0e256392..3c3869a2 100644 --- a/git_command.py +++ b/git_command.py | |||
@@ -196,12 +196,10 @@ class UserAgent: | |||
196 | def git(self): | 196 | def git(self): |
197 | """The UA when running git.""" | 197 | """The UA when running git.""" |
198 | if self._git_ua is None: | 198 | if self._git_ua is None: |
199 | self._git_ua = "git/%s (%s) git-repo/%s" % ( | 199 | self._git_ua = ( |
200 | git.version_tuple().full, | 200 | f"git/{git.version_tuple().full} ({self.os}) " |
201 | self.os, | 201 | f"git-repo/{RepoSourceVersion()}" |
202 | RepoSourceVersion(), | ||
203 | ) | 202 | ) |
204 | |||
205 | return self._git_ua | 203 | return self._git_ua |
206 | 204 | ||
207 | 205 | ||
@@ -216,7 +214,7 @@ def git_require(min_version, fail=False, msg=""): | |||
216 | need = ".".join(map(str, min_version)) | 214 | need = ".".join(map(str, min_version)) |
217 | if msg: | 215 | if msg: |
218 | msg = " for " + msg | 216 | msg = " for " + msg |
219 | error_msg = "fatal: git %s or later required%s" % (need, msg) | 217 | error_msg = f"fatal: git {need} or later required{msg}" |
220 | logger.error(error_msg) | 218 | logger.error(error_msg) |
221 | raise GitRequireError(error_msg) | 219 | raise GitRequireError(error_msg) |
222 | return False | 220 | return False |
@@ -243,7 +241,7 @@ def _build_env( | |||
243 | env["GIT_SSH"] = ssh_proxy.proxy | 241 | env["GIT_SSH"] = ssh_proxy.proxy |
244 | env["GIT_SSH_VARIANT"] = "ssh" | 242 | env["GIT_SSH_VARIANT"] = "ssh" |
245 | if "http_proxy" in env and "darwin" == sys.platform: | 243 | if "http_proxy" in env and "darwin" == sys.platform: |
246 | s = "'http.proxy=%s'" % (env["http_proxy"],) | 244 | s = f"'http.proxy={env['http_proxy']}'" |
247 | p = env.get("GIT_CONFIG_PARAMETERS") | 245 | p = env.get("GIT_CONFIG_PARAMETERS") |
248 | if p is not None: | 246 | if p is not None: |
249 | s = p + " " + s | 247 | s = p + " " + s |
@@ -468,7 +466,7 @@ class GitCommand: | |||
468 | ) | 466 | ) |
469 | except Exception as e: | 467 | except Exception as e: |
470 | raise GitPopenCommandError( | 468 | raise GitPopenCommandError( |
471 | message="%s: %s" % (command[1], e), | 469 | message=f"{command[1]}: {e}", |
472 | project=self.project.name if self.project else None, | 470 | project=self.project.name if self.project else None, |
473 | command_args=self.cmdv, | 471 | command_args=self.cmdv, |
474 | ) | 472 | ) |