Subject: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29, fail on master

From: João Távora <[email-masked]>
Date: Sun, 09 Apr 2023 20:13:05 +0100

Basil Contovounesios <[email-masked]> writes:

> diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
> index 62e04539ebf..041aafabe8e 100644
> --- a/test/lisp/progmodes/eglot-tests.el
> +++ b/test/lisp/progmodes/eglot-tests.el
> @@ -325,8 +325,7 @@ eglot-test-eclipse-connect
>    "Connect to eclipse.jdt.ls server."
>    (skip-unless (executable-find "jdtls"))
>    (eglot--with-fixture
> -      '(("project/src/main/java/foo" . (("Main.java" . "")))
> -        ("project/.git/" . nil))
> +      '(("project/src/main/java/foo" . (("Main.java" . ""))))
>      (with-current-buffer
>          (eglot--find-file-noselect "project/src/main/java/foo/Main.java")
>        (eglot--sniffing (:server-notifications s-notifs)
>
>
> Which I assume means that project-current picks up .git as a project
> root marker, but project-files unexpectedly finds no registered files.
>
> I'm not sure whether this is expected on either the project or eglot
> side.  If I squint hard enough it kind of reminds me of bug#62735.

I think the change is fine, please install it, and thanks.  Let's hope
it doesn't break on Emacs 26.3, 27 and 28 

(f you could test, it would be great, if not it's OK.  It'd involve
making a GitHub fork and using the GitHub actions scripts)

A safer, but slightly slower route:

   (should (zerop (shell-command "git init")))

Some tests known to need project-files already do this.

But why does it pass on Emacs 29?? Maybe project-files simply doesn't
error there?

João