From 5b4456728ef7957d5e858d41834adbb7eeab8b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Mon, 18 Mar 2024 19:47:59 +0100 Subject: [PATCH] Fix vc-git test when no identities are configured Reported by john muhl . * test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo): Set some environment variables (lifted from vc-tests.el) to let 'git commit' compute dummy author and committer identities. --- test/lisp/vc/vc-git-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el index fd3e8ccd602..bbf0c4277dd 100644 --- a/test/lisp/vc/vc-git-tests.el +++ b/test/lisp/vc/vc-git-tests.el @@ -88,10 +88,17 @@ vc-git-test--with-repo The current directory will be set to the top of that repository; NAME will be bound to that directory's file name. Once BODY exits, the -directory will be deleted." +directory will be deleted. + +Some dummy environment variables will be set for the duration of BODY to +allow 'git commit' to determine identities for authors and committers." (declare (indent 1)) `(ert-with-temp-directory ,name - (let ((default-directory ,name)) + (let ((default-directory ,name) + (process-environment (append '("EMAIL=john@doe.ee" + "GIT_AUTHOR_NAME=A" + "GIT_COMMITTER_NAME=C") + process-environment))) (vc-create-repo 'Git) ,@body))) -- 2.44.0