commit:     c46fd4e6669ed49593abe4a4b3d16cbf6fc8814e
Author:     Jernej Jakob <jernej.jakob <AT> gmail <DOT> com>
AuthorDate: Sat Oct 21 22:35:26 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 22 18:58:38 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c46fd4e6

sync: git: Fix error with repositories with git config "log.showSignature" 
enabled

For example, emaint sync will show "No valid signature found: unknown issue".
This can be because the user has set "log.showSignature" in their git
config, which produces output that portage doesn't expect.
To prevent this, explicitly disable "log.showSignature" when calling
git.

Signed-off-by: Jernej Jakob <jernej.jakob <AT> gmail.com>
Closes: https://github.com/gentoo/portage/pull/1140
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/sync/modules/git/git.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/portage/sync/modules/git/git.py 
b/lib/portage/sync/modules/git/git.py
index ead276a98d..4b11e3fa85 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -447,7 +447,15 @@ class GitSync(NewBase):
                 env = os.environ.copy()
                 env["GNUPGHOME"] = openpgp_env.home
 
-            rev_cmd = [self.bin_command, "log", "-n1", "--pretty=format:%G?", 
revision]
+            rev_cmd = [
+                self.bin_command,
+                "-c",
+                "log.showsignature=0",
+                "log",
+                "-n1",
+                "--pretty=format:%G?",
+                revision,
+            ]
             try:
                 status = portage._unicode_decode(
                     subprocess.check_output(

Reply via email to