From 16246ea32371ff70c8941756af75ddefb8c97f4e Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 31 Dec 2022 11:29:02 +0100 Subject: 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 Closes: https://github.com/gentoo/portage/pull/968 Signed-off-by: Sam James --- NEWS | 2 ++ lib/portage/sync/modules/git/git.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3-65-gdbad