]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix vc-git test when no identities are configured
authorKévin Le Gouguec <kevin.legouguec@gmail.com>
Mon, 18 Mar 2024 18:47:59 +0000 (19:47 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Mar 2024 14:13:00 +0000 (15:13 +0100)
Reported by john muhl <jm@pub.pink>.

* 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.

(cherry picked from commit 014cd0040275bb2a4d08d392825b4814452275db)

test/lisp/vc/vc-git-tests.el

index fd3e8ccd6022842edba1dad0aa8cdb2d4318f16d..bbf0c4277dd54a1db2acbfab09a433fafb1772d1 100644 (file)
 
 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)))