commit: 16246ea32371ff70c8941756af75ddefb8c97f4e
Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 31 10:29:02 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 31 14:11:23 2022 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=16246ea3
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 <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/968
Signed-off-by: Sam James <sam <AT> gentoo.org>
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: