From b3660cf1351e9ffeb7dc127f53a82171e89e155c Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 18 Aug 2023 12:03:58 +0300 Subject: [PATCH] * testing/lisp/test-org-attach-git.el: Avoid using global git config (test-org-attach-git/with-annex): Disable global git config during testing. --- testing/lisp/test-org-attach-git.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/testing/lisp/test-org-attach-git.el b/testing/lisp/test-org-attach-git.el index cc2a1dc62..e8b41fe8c 100644 --- a/testing/lisp/test-org-attach-git.el +++ b/testing/lisp/test-org-attach-git.el @@ -28,9 +28,16 @@ (unwind-protect (let ((default-directory tmpdir) (org-attach-id-dir tmpdir)) - (shell-command "git init") - (shell-command "git annex init") - ,@body)))) + ;; Ignore global git config. + (with-environment-variables + (("GIT_CONFIG_GLOBAL" (concat tmpdir ".global-config")) + ("GIT_CONFIG_SYSTEM" "")) + ;; Otherwise, some git operations may err. + (shell-command "git config --global user.email \"john.doe@example.com\"") + (shell-command "git config --global user.name \"John Doe\"") + (shell-command "git init") + (shell-command "git annex init") + ,@body))))) (ert-deftest test-org-attach-git/use-annex () (test-org-attach-git/with-annex