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

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

 



On Wed, Dec 18, 2013 at 3:44 PM, Antoine Pelisse <apelisse@xxxxxxxxx> wrote:
> FWIW, git-bisect points to 84b8b5d (that is $gmane/230349).
>
> On Wed, Dec 18, 2013 at 9:06 AM, Thomas Ferris Nicolaisen
> <tfnico@xxxxxxxxx> wrote:
>> This was discussed on the Git user list recently [1].
>>
>> #in a repo with no files
>>> git add -A
>> fatal: pathspec '.' did not match any files
>>
>> The same goes for git add . (and -u).
>>
>> Whereas I think some warning feedback is useful, we are curious
>> whether this is an intentional change or not.

I was not aware of this case when I made the change. It's caused by
this change that removes pathspec.raw[i][0] check in builtin/add.c in
84b8b5d .

-               for (i = 0; pathspec.raw[i]; i++) {
-                       if (!seen[i] && pathspec.raw[i][0]
-                           && !file_exists(pathspec.raw[i])) {
+               for (i = 0; i < pathspec.nr; i++) {
+                       const char *path = pathspec.items[i].match;
+                       if (!seen[i] && !file_exists(path)) {

Adding it back requires some thinking because "path" in the new code
could be something magic.. and the new behavior makes sense, so I'm
inclined to keep it as is, unless people have other opinions.

>>
>> [1] https://groups.google.com/d/topic/git-users/Qs4YSPhTsqE/discussion
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]