From: Junio C Hamano Date: Wed, 20 Dec 2006 21:06:46 +0000 (-0800) Subject: git-add: error out when given no arguments. X-Git-Tag: v1.5.0-rc0~58 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=93b0d86aafdd3e00de2c3c6ebb3c109b4571e1c4;p=git.git git-add: error out when given no arguments. Signed-off-by: Junio C Hamano --- diff --git a/builtin-add.c b/builtin-add.c index c8a114fef..f306f82b1 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -111,6 +111,11 @@ int cmd_add(int argc, const char **argv, const char *prefix) } usage(builtin_add_usage); } + if (argc <= i) { + fprintf(stderr, "Nothing specified, nothing added.\n"); + fprintf(stderr, "Maybe you wanted to say 'git add .'?\n"); + return 0; + } pathspec = get_pathspec(prefix, argv + i); fill_directory(&dir, pathspec);