Subject: Re: git add -A fails in empty repository since 1.8.5

From: Matthieu Moy <[email-masked]>
Date: Wed, 18 Dec 2013 20:24:35 +0100

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

> It could be argued that a "git add [<any option>] .", with an
> explicit "." given by the end-user, that is run in an empty
> directory may be an error worth reporting.

But what we have right now is really weird:

# setup repo with one empty dir:
$ rm -fr test
$ git init test
Initialized empty Git repository in /tmp/test/.git/
$ cd test
$ mkdir foo

$ git add .
fatal: pathspec '.' did not match any files

=> The one we're discussing.

$ git add foo

=> No error when an empty directory other than . is given.

$ cd foo
$ git add .

=> No error either for "git add ." when not at the root of the repo.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/