Skip to content

Commit 9748e39

Browse files
stefanbellergitster
authored andcommitted
submodule deinit: handle non existing pathspecs gracefully
This fixes a regression introduced in 2e61273 (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 <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2e61273 commit 9748e39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/submodule--helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ static int module_deinit(int argc, const char **argv, const char *prefix)
10421042
die(_("Use '--all' if you really want to deinitialize all submodules"));
10431043

10441044
if (module_list_compute(argc, argv, prefix, &pathspec, &list) < 0)
1045-
BUG("module_list_compute should not choke on empty pathspec");
1045+
return 1;
10461046

10471047
info.prefix = prefix;
10481048
if (quiet)

0 commit comments

Comments
 (0)