Subject: Re: bug#26066: 26.0.50; vc-git-status gives wrong result

From: [email-masked]
Date: Wed, 15 Mar 2017 20:42:54 -0400

[Please use Reply All to keep [email-masked] on Cc]

Subject: Re: bug#26066: 26.0.50; vc-git-status gives wrong result
From: Jonathan Ganc <[email-masked]>
To: [email-masked]
Date: Tue, 14 Mar 2017 20:25:57 -0400

The actual problem is with the function vc-git--empty-db-p, which acts 
in the directory default-directory (implicitly, through vc-git--call and 
then process-file). Thus, I think replacing (in vc-git-state)
(vc-git--empty-db-p)
with
(let ((default-directory (file-name-directory file)))
   (vc-git--empty-db-p))
should resolve the issue without side effect.

As an aside, is there a reason that vc-git-status does not use "git 
status -z --porcelain --ignored"? It seems more natural/straightfoward 
and it would also deal with ignored and removed files. It could also 
work with directories, which the current function doesn't.

Let-binding default-directory sounds okay.

Regarding 'status -z --porcelain', I think it might not have been
available at the time te code was written.  I'm not sure how far back we
need to maintain compatibility.