Merge branch 'nd/add-empty-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Jan 2014 18:33:03 +0000 (10:33 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jan 2014 18:33:03 +0000 (10:33 -0800)
"git add -A" (no other arguments) in a totally empty working tree
used to emit an error.

* nd/add-empty-fix:
add: don't complain when adding empty project root

1  2 
builtin/add.c
diff --cc builtin/add.c
index 0df73ae73596546966af18e7076d9a6f54964786,d7e3e44d06cdf56ac661600788cfdf751037226e..2a2722fa10aa981695b21984e7c425c35b4f18d0
@@@ -545,9 -544,7 +545,9 @@@ int cmd_add(int argc, const char **argv
  
                for (i = 0; i < pathspec.nr; i++) {
                        const char *path = pathspec.items[i].match;
-                       if (!seen[i] &&
 +                      if (pathspec.items[i].magic & PATHSPEC_EXCLUDE)
 +                              continue;
+                       if (!seen[i] && path[0] &&
                            ((pathspec.items[i].magic &
                              (PATHSPEC_GLOB | PATHSPEC_ICASE)) ||
                             !file_exists(path))) {