git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG]: Non-matching exclude pathspec causes an error in empty repository when the flag "--update" is present
@ 2025-05-27  8:14 Piotr Siupa
  2025-06-02 10:07 ` Phillip Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Piotr Siupa @ 2025-05-27  8:14 UTC (permalink / raw)
  To: git

I found a regression in version 2.45.0. (It's still present in the
current next - 2.49.0.1266.g31b7d2e469; earlier versions work fine.)

When you run "git add --update" with an exclude pathspec on an empty
repository, the command fails, showing an error about not being able
to find the specified files.
This happens only if the repository contains no files. Adding any
files (even with "git add -N") or making a non-empty commit fixes the
issue, regardless of whether the added files match the exclude
pathspec or not.

Way to reproduce:
git init
git add --update -- ':(exclude)foo'

This results in:
error: pathspec ':(exclude)foo' did not match any file(s) known to git
error: pathspec '.' did not match any file(s) known to git

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-10  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27  8:14 [BUG]: Non-matching exclude pathspec causes an error in empty repository when the flag "--update" is present Piotr Siupa
2025-06-02 10:07 ` Phillip Wood
2025-06-02 15:31   ` Junio C Hamano
2025-06-10  9:41     ` Piotr Siupa
2025-06-10  9:45       ` Piotr Siupa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).