* testing/lisp/test-org-attach-git.el: Avoid using global git config

(test-org-attach-git/with-annex): Disable global git config during
testing.
This commit is contained in:
Ihor Radchenko 2023-08-18 12:03:58 +03:00
parent 2eb4fd8900
commit b3660cf135
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 10 additions and 3 deletions

View File

@ -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