From: Junio C Hamano Date: Sat, 17 Apr 2010 16:38:12 GMT Subject: Re: [BUG] Git add silently fails Message-ID: <7v4oja3uh7.fsf@alter.siamese.dyndns.org> In-Reply-To: Alex Riesen writes: > I think something like this should make the accident more > noticable: The early skippage done in dir.c (read-directory-recursive) should treat these as ignored just like paths that are ignored with .gitignore mechanism, and if we do so, we shouldn't need this patch to add another codepath to give notification to the user (we would however still need to reword "'add -f' if you really want to add it", though). > diff --git a/builtin/add.c b/builtin/add.c > index 87d2980..9c4a5f2 100644 > --- a/builtin/add.c > +++ b/builtin/add.c > @@ -347,6 +347,8 @@ static int add_files(struct dir_struct *dir, int flags) > die("no files added"); > } > > + if (!dir->nr) > + die("No files selected for addition"); > for (i = 0; i < dir->nr; i++) > if (add_file_to_cache(dir->entries[i]->name, flags)) { > if (!ignore_add_errors)