Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: /, lib/portage/sync/modules/git/
Date: Sat, 31 Dec 2022 14:11:35
Message-Id: 1672495883.16246ea32371ff70c8941756af75ddefb8c97f4e.sam@gentoo
1 commit: 16246ea32371ff70c8941756af75ddefb8c97f4e
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 31 10:29:02 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 31 14:11:23 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=16246ea3
7
8 git.py: fix "is-shallow-repository" check by stripping \n
9
10 The output of git commands has a trailing newline character which we
11 usually strip.
12
13 Fixes: da8e7d193563a2b0c88a523083b2a3466ff4526e ("sync: git: only perform shallow updates if the repository is shallow")
14 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
15 Closes: https://github.com/gentoo/portage/pull/968
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 NEWS | 2 ++
19 lib/portage/sync/modules/git/git.py | 2 +-
20 2 files changed, 3 insertions(+), 1 deletion(-)
21
22 diff --git a/NEWS b/NEWS
23 index 088ab5f15..3dda33ea1 100644
24 --- a/NEWS
25 +++ b/NEWS
26 @@ -11,6 +11,8 @@ Bug fixes:
27 Whirlpool is considered deprecated within Portage and we recommend that
28 repository maintainers remove it from `metadata/layout.conf`!
29
30 +* Fix "is shallow git repository" check.
31 +
32 portage-3.0.42 (2022-12-26)
33 --------------
34
35
36 diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py
37 index fe8a2c995..88f19cccf 100644
38 --- a/lib/portage/sync/modules/git/git.py
39 +++ b/lib/portage/sync/modules/git/git.py
40 @@ -237,7 +237,7 @@ class GitSync(NewBase):
41 is_shallow_cmd,
42 cwd=portage._unicode_encode(self.repo.location),
43 )
44 - )
45 + ).rstrip("\n")
46 if is_shallow_res == "false":
47 sync_depth = 0
48 else: