Skip to content

Commit

Permalink
git-add: error out when given no arguments.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Dec 20, 2006
1 parent 5485115 commit 93b0d86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin-add.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 93b0d86

Please sign in to comment.