bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65704: 29.1; Most code of `project-ignores' seems to be dead code


From: Dmitry Gutov
Subject: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code
Date: Sun, 3 Sep 2023 03:26:48 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi Damien,

Thanks for the patch, pushed to master (with a few amendments in summary).

I'd like to backport it to emacs-29 as well, if Eli/Stefan don't mind.

On 02/09/2023 19:03, Damien Cassou wrote:
Hi,

The function `project-ignores' starts like this:

   (cl-defmethod project-ignores ((project (head vc)) dir)
     (let* ((root (nth 2 project))
            backend)
       (append
        (when (and backend
                   (file-equal-p dir root))

It seems to me that `backend' is always going to be nil at this point
and thus the 25-line long `when' block will always return nil without
doing anything.

Am I missing something?

Not much. Maybe just that that code path isn't exercised by any in-tree function if the backend is Git (with recent enough git installed) or Hg (the project-files method uses faster, specialized shell invocations), so that might be the reason why this was missed in testing.

Any chance you could tell us what made you notice the bug?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]