aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2022-12-31 11:29:02 +0100
committerSam James <sam@gentoo.org>2022-12-31 14:11:23 +0000
commit16246ea32371ff70c8941756af75ddefb8c97f4e (patch)
tree7ec8e659d0a8fa1e63ea6520d0a72114d7e45381
parentReport a warning when unaccelerated Whirlpool is being used (diff)
downloadportage-16246ea3.tar.gz
portage-16246ea3.tar.bz2
portage-16246ea3.zip
git.py: fix "is-shallow-repository" check by stripping \n
The output of git commands has a trailing newline character which we usually strip. Fixes: da8e7d193563a2b0c88a523083b2a3466ff4526e ("sync: git: only perform shallow updates if the repository is shallow") Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/968 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--NEWS2
-rw-r--r--lib/portage/sync/modules/git/git.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 088ab5f15..3dda33ea1 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Bug fixes:
Whirlpool is considered deprecated within Portage and we recommend that
repository maintainers remove it from `metadata/layout.conf`!
+* Fix "is shallow git repository" check.
+
portage-3.0.42 (2022-12-26)
--------------
diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py
index fe8a2c995..88f19cccf 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -237,7 +237,7 @@ class GitSync(NewBase):
is_shallow_cmd,
cwd=portage._unicode_encode(self.repo.location),
)
- )
+ ).rstrip("\n")
if is_shallow_res == "false":
sync_depth = 0
else: