From: Junio C Hamano Date: Fri, 10 Jan 2014 18:33:03 +0000 (-0800) Subject: Merge branch 'nd/add-empty-fix' X-Git-Tag: v1.9-rc0~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ba46c28471b94de561d00f8b01da79b59527c62;p=thirdparty%2Fgit.git 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 --- 4ba46c28471b94de561d00f8b01da79b59527c62 diff --cc builtin/add.c index 0df73ae735,d7e3e44d06..2a2722fa10 --- a/builtin/add.c +++ b/builtin/add.c @@@ -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 (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))) {