summaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-20 21:06:46 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-20 21:41:00 (GMT)
commit93b0d86aafdd3e00de2c3c6ebb3c109b4571e1c4 (patch)
tree2bb773075f9682297af82e0c6afdd1243faa233e /builtin-add.c
parent54851157acf707eb953eada2a84830897dde5c1d (diff)
downloadgit-93b0d86aafdd3e00de2c3c6ebb3c109b4571e1c4.zip
git-93b0d86aafdd3e00de2c3c6ebb3c109b4571e1c4.tar.gz
git-93b0d86aafdd3e00de2c3c6ebb3c109b4571e1c4.tar.bz2
git-add: error out when given no arguments.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-add.c')
-rw-r--r--builtin-add.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-add.c b/builtin-add.c
index c8a114f..f306f82 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);