diff options
-rw-r--r-- | builtin-add.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-add.c b/builtin-add.c index c8a114fefb..f306f82b16 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); |