project.el: Fix in submodules with nonexistent git root (bug#80402)

project-try-vc--search in a submodule directory tries to find the git
root directory, so the local variable root would be set to nil if it
didn't exist. Calling project--vc-merge-submodules-p on nil would lead
to a crash, so now the while loop aborts beforehand.
This commit is contained in:
Heinz Fridolin 2026-02-15 02:37:47 +01:00 committed by Dmitry Gutov
parent 9a5eafa8c3
commit e2bf7ce8b6

View file

@ -698,6 +698,7 @@ in the `project-current' call, the timeout is determined by
vc-handled-backends))
project)
(while (and
root
(eq backend 'Git)
(project--vc-merge-submodules-p root)
(project--submodule-p root))