commit:     f101272f139e1494dcef90554bbc24db5f66d401
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Tue Oct 18 20:40:03 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 23:36:19 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f101272f

sync: git: Fix sync printing local repo path

In the add_safe_directory method in the git sync module
the subprocess calling 'git config --get safe.directory <repo_location>'
prints the path to the local repo.
Directing the subprocess output to DEVNULL fixes the issue.

Bug: https://bugs.gentoo.org/875812
Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/portage/pull/924
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                | 2 ++
 lib/portage/sync/modules/git/git.py | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 3e2a5a2d6..39c94efac 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,8 @@ Bug fixes:
 * emerge(1), make.conf(5), xpak(5): document BINPKG_FORMAT and the gpkg binary
   packate format further.
 
+* sync: git: Fix sync printing local repo path (bug #875812)
+
 portage-3.0.38.1 (2022-10-04)
 --------------
 

diff --git a/lib/portage/sync/modules/git/git.py 
b/lib/portage/sync/modules/git/git.py
index 31ce5febf..b4c470160 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -362,7 +362,8 @@ class GitSync(NewBase):
                 "--get",
                 "safe.directory",
                 f"^{location_escaped}$",
-            ]
+            ],
+            stdout=subprocess.DEVNULL,
         )
         if result.returncode == 1:
             result = subprocess.run(
@@ -373,6 +374,7 @@ class GitSync(NewBase):
                     "--add",
                     "safe.directory",
                     self.repo.location,
-                ]
+                ],
+                stdout=subprocess.DEVNULL,
             )
         return result.returncode == 0

Reply via email to