aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--cgitize/cgit.py2
-rw-r--r--cgitize/utils.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/cgitize/cgit.py b/cgitize/cgit.py
index 0b9e381..1707f83 100644
--- a/cgitize/cgit.py
+++ b/cgitize/cgit.py
@@ -143,7 +143,7 @@ class CGitRepositories:
)
return self._mirror(repo)
- if f"{repo.clone_url}\n" != output:
+ if f"{repo.clone_url}" != output:
# Jeez, there's a proper local repository in the target
# directory already with a different upstream; something's
# wrong, fix it manually.
diff --git a/cgitize/utils.py b/cgitize/utils.py
index f322516..53f8760 100644
--- a/cgitize/utils.py
+++ b/cgitize/utils.py
@@ -47,13 +47,15 @@ def run(*args, capture_output=False, **kwargs):
stdout = subprocess.PIPE
stderr = subprocess.STDOUT
- logging.debug("Running: %s", subprocess.list2cmdline(args).rstrip())
+ logging.debug("Running: %s", subprocess.list2cmdline(args))
result = subprocess.run(
args, check=True, stdout=stdout, stderr=stderr, encoding="utf-8", **kwargs
)
if result.stdout is not None:
- logging.debug("\n%s", result.stdout)
+ if result.stdout[-1] == "\n":
+ result.stdout = result.stdout[:-1]
+ logging.debug("%s", result.stdout)
return result.stdout