+
Skip to content

Add a check to prevent max_children from being 0, which may cause potential divide-by-zero. #1975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,7 @@ int cmd_fetch(int argc,
die(_("--stdin can only be used when fetching "
"from one remote"));

if (max_children < 0)
if (max_children <= 0)
max_children = config.parallel;

/* TODO should this also die if we have a previous partial-clone? */
Expand All @@ -2613,9 +2613,9 @@ int cmd_fetch(int argc,
struct strvec options = STRVEC_INIT;
int max_children = max_jobs;

if (max_children < 0)
if (max_children <= 0)
max_children = config.submodule_fetch_jobs;
if (max_children < 0)
if (max_children <= 0)
max_children = config.parallel;

add_options_to_argv(&options, &config);
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载