summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-03-27 23:28:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-28 05:07:13 (GMT)
commit9748e39d0c17a79e67d2728199515cf40e2850dc (patch)
tree152bf2de769beb8ca66bcbd7af0e10819b2f7c86 /builtin
parent2e612731b55f1a83fb5b7f4ecb9391f0cba63cb2 (diff)
downloadgit-9748e39d0c17a79e67d2728199515cf40e2850dc.zip
git-9748e39d0c17a79e67d2728199515cf40e2850dc.tar.gz
git-9748e39d0c17a79e67d2728199515cf40e2850dc.tar.bz2
submodule deinit: handle non existing pathspecs gracefully
This fixes a regression introduced in 2e612731b5 (submodule: port submodule subcommand 'deinit' from shell to C, 2018-01-15), when handling pathspecs that do not exist gracefully. This restores the historic behavior of reporting the pathspec as unknown and returning instead of reporting a bug. Reported-by: Peter Oberndorfer <kumbayo84@arcor.de> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/submodule--helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index b1daca9..b5d3713 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1042,7 +1042,7 @@ static int module_deinit(int argc, const char **argv, const char *prefix)
die(_("Use '--all' if you really want to deinitialize all submodules"));
if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
- BUG("module_list_compute should not choke on empty pathspec");
+ return 1;
info.prefix = prefix;
if (quiet)