projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5485115
)
git-add: error out when given no arguments.
author
Junio C Hamano
<junkio@cox.net>
Wed, 20 Dec 2006 21:06:46 +0000
(13:06 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Wed, 20 Dec 2006 21:41:00 +0000
(13:41 -0800)
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-add.c
patch
|
blob
|
history
diff --git
a/builtin-add.c
b/builtin-add.c
index c8a114fefb60a106dccffda5c703f2f00fa30ce9..f306f82b16c3c3c76416610cd4cabf0a307924ed 100644
(file)
--- 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);