From 3762b4660719c548050953e9854ab2f0973ce845 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 9 May 2025 14:43:03 +0300 Subject: [PATCH] ; Fix VC tests * test/lisp/vc/vc-tests/vc-tests.el (vc-test-hg06-version-diff): Skip on MS-Windows in batch mode. * test/lisp/vc/vc-git-tests.el (vc-git-test--start-branch): More portable command for showing the current branch ("--show-current" is only available since Git 2.22). (cherry picked from commit b87608c9c7fd3a7a2a2fb3803d6038fa888602c4) --- test/lisp/vc/vc-git-tests.el | 2 +- test/lisp/vc/vc-tests/vc-tests.el | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el index 3cb12d5f86e..eca7baaa88e 100644 --- a/test/lisp/vc/vc-git-tests.el +++ b/test/lisp/vc/vc-git-tests.el @@ -122,7 +122,7 @@ agnostic of init.defaultbranch." (write-region "hello" nil "README") (vc-git-test--run "add" "README") (vc-git-test--run "commit" "-mFirst") - (string-trim (vc-git-test--run "branch" "--show-current"))) + (string-trim (vc-git-test--run "rev-parse" "--abbrev-ref" "HEAD"))) (defun vc-git-test--dir-headers (headers) "Return an alist of header values as they would appear in `vc-dir'. diff --git a/test/lisp/vc/vc-tests/vc-tests.el b/test/lisp/vc/vc-tests/vc-tests.el index e7852d53f99..632a6a792bd 100644 --- a/test/lisp/vc/vc-tests/vc-tests.el +++ b/test/lisp/vc/vc-tests/vc-tests.el @@ -785,6 +785,11 @@ This checks also `vc-backend' and `vc-responsible-backend'." ;; `vc-mtn.el' gives me: ;; "Failed (status 1): mtn commit -m Testing vc-version-diff\n\n foo" (skip-when (memq ',backend '(Mtn))) + ;; `vc-hg.el' gives me, only on MS-Windows and only in batch mode: + ;; "Failed (status 255): hg --config ui.report_untrusted=0 commit -m Testing vc-version-diff\n\n foo" + (skip-when (and (memq ',backend '(Hg)) + (eq system-type 'windows-nt) + noninteractive)) (vc-test--version-diff ',backend)) )))) -- 2.39.5