Skip to content

Commit

Permalink
git fetch by default parallel and using all CPU threads
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanAizek committed Aug 11, 2024
1 parent 84c8fcc commit d6e2170
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Git.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,8 @@ bool Git::pull(AbstractPtyProcess *pty)

bool Git::fetch(AbstractPtyProcess *pty, bool prune)
{
QString cmd = "fetch --tags -f";
QString cmd = "fetch --tags -f -j%1";
cmd = cmd.arg(std::thread::hardware_concurrency());
if (prune) {
cmd += " --prune";
}
Expand All @@ -1370,7 +1371,8 @@ bool Git::fetch(AbstractPtyProcess *pty, bool prune)

bool Git::fetch_tags_f(AbstractPtyProcess *pty)
{
QString cmd = "fetch --tags -f";
QString cmd = "fetch --tags -f -j%1";
cmd = cmd.arg(std::thread::hardware_concurrency());
Option opt;
opt.pty = pty;
return git(cmd, opt);
Expand Down

0 comments on commit d6e2170

Please sign in to comment.