diff options
Diffstat (limited to 'builtin-add.c')
-rw-r--r-- | builtin-add.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin-add.c b/builtin-add.c index 9443bae535..17641b433d 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -3,8 +3,6 @@ * * Copyright (C) 2006 Linus Torvalds */ -#include <fnmatch.h> - #include "cache.h" #include "builtin.h" #include "dir.h" @@ -128,6 +126,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); |