Merge branch 'nd/add-empty-fix'

"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
This commit is contained in:
Junio C Hamano
2014-01-10 10:33:03 -08:00
2 changed files with 20 additions and 1 deletions

View File

@ -547,7 +547,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
const char *path = pathspec.items[i].match;
if (pathspec.items[i].magic & PATHSPEC_EXCLUDE)
continue;
if (!seen[i] &&
if (!seen[i] && path[0] &&
((pathspec.items[i].magic &
(PATHSPEC_GLOB | PATHSPEC_ICASE)) ||
!file_exists(path))) {