summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-10 10:33:03 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-10 10:33:03 -0800
commit4ba46c28471b94de561d00f8b01da79b59527c62 (patch)
tree288962cb17e69b5f144e179fec91baceadcfc6a0 /builtin/add.c
parent0c52457b7c6311d004d0fb1f5b7bb7d5cc6dbf4e (diff)
parent64ed07cee0394509c65331f1e7acb36c58fd18fb (diff)
downloadgit-4ba46c28471b94de561d00f8b01da79b59527c62.tar.gz
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
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 0df73ae735..2a2722fa10 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -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))) {