Subject: Re: Regression in v2.26.0-rc0 and Magit

From: Kyle Meyer <[email-masked]>
Date: Sat, 14 Mar 2020 05:57:40 +0000

Junio C Hamano <[email-masked]> writes:

> That does not still explain why Magit (which is sufficiently mature)
> is expecting "cd .git && ls-files .." to show the entire working
> tree, though.

The specific ls-files call that seems to trigger the segfault on Magit's
end is equivalent to

  cd .git && git ls-files --error-unmatch -- $PWD/COMMIT_EDITMSG

The code is running ls-files to ask whether the file is tracked, which
of course isn't a sensible thing to do outside of the working tree.
I'll propose a change on Magit's end to avoid doing so.

[ A few more specifics that might be of interest to Magit users ]

This happens in magit-auto-revert-mode.  When visiting a file in .git/
(e.g., COMMIT_EDITMSG when committing), magit-auto-revert-mode decides
whether to turn on auto-revert-mode in the same way it does for other
files, magit-turn-on-auto-revert-mode-if-desired.  That function doesn't
distinguish whether the file is in .git or the working tree, leading to
the odd "is tracked file?" query above.