Make sure git gc runs if needed when syncing git mirrors in cache dir to avoid them getting very stale

main
Jordi Boggiano 4 years ago
parent 6937fedaa9
commit 852990d06c
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -261,7 +261,7 @@ class Git
$commandCallable = function ($url) {
$sanitizedUrl = preg_replace('{://([^@]+?):(.+?)@}', '://', $url);
return sprintf('git remote set-url origin %s && git remote update --prune origin && git remote set-url origin %s', ProcessExecutor::escape($url), ProcessExecutor::escape($sanitizedUrl));
return sprintf('git remote set-url origin %s && git remote update --prune origin && git remote set-url origin %s && git gc --auto', ProcessExecutor::escape($url), ProcessExecutor::escape($sanitizedUrl));
};
$this->runCommand($commandCallable, $url, $dir);
} catch (\Exception $e) {

Loading…
Cancel
Save