diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-01 03:13:10 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-05 00:44:10 -0800 |
commit | 1abf0950638d4f3279d059a1365da9c253d5718a (patch) | |
tree | 215a85a6554280fd44ffb2dc81464045a92ebe76 /builtin-add.c | |
parent | 097971f5f564dbd832eea774ae0cdcfa03ba35ac (diff) | |
download | git-1abf0950638d4f3279d059a1365da9c253d5718a.tar.gz |
git-add: adjust to the get_pathspec() changes.
We would need to notice and fail if command line had a nonsense pathspec.
Earlier get_pathspec() returned all the inputs including bad ones, but
the new one issues warnings and removes offending ones from its return
value, so the callers need to be adjusted to notice it.
Additional test scripts were initially from Robin Rosenberg, further fixed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-add.c')
-rw-r--r-- | builtin-add.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin-add.c b/builtin-add.c index 4a91e3eb11..820110e085 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -228,6 +228,18 @@ int cmd_add(int argc, const char **argv, const char *prefix) goto finish; } + if (*argv) { + /* Was there an invalid path? */ + if (pathspec) { + int num; + for (num = 0; pathspec[num]; num++) + ; /* just counting */ + if (argc != num) + exit(1); /* error message already given */ + } else + exit(1); /* error message already given */ + } + fill_directory(&dir, pathspec, ignored_too); if (show_only) { |