diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-12-23 16:02:41 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-26 10:46:26 -0800 |
commit | 64ed07cee0394509c65331f1e7acb36c58fd18fb (patch) | |
tree | 8f97367baeb48a5b6974101f88e3673b80ee54ae /builtin/add.c | |
parent | d2446dfd7f3b3f8948142cfb07a0270e2497d93f (diff) | |
download | git-64ed07cee0394509c65331f1e7acb36c58fd18fb.tar.gz |
add: don't complain when adding empty project rootnd/add-empty-fix
This behavior was added in 07d7bed (add: don't complain when adding
empty project root - 2009-04-28) then broken by 84b8b5d (remove
match_pathspec() in favor of match_pathspec_depth() -
2013-07-14). Reinstate it.
Noticed-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/add.c')
-rw-r--r-- | builtin/add.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c index 226f758869..d7e3e44d06 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -544,7 +544,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) for (i = 0; i < pathspec.nr; i++) { const char *path = pathspec.items[i].match; - if (!seen[i] && + if (!seen[i] && path[0] && ((pathspec.items[i].magic & (PATHSPEC_GLOB | PATHSPEC_ICASE)) || !file_exists(path))) { |