From 64ed07cee0394509c65331f1e7acb36c58fd18fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 23 Dec 2013 16:02:41 +0700 Subject: add: don't complain when adding empty project root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Nguyễn Thái Ngọc Duy Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/add.c') 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))) { -- cgit v1.2.1