Make sure git gc runs if needed when syncing git mirrors in cache dir to avoid them getting very stale
parent
6937fedaa9
commit
852990d06c
|
@ -261,7 +261,7 @@ class Git
|
||||||
$commandCallable = function ($url) {
|
$commandCallable = function ($url) {
|
||||||
$sanitizedUrl = preg_replace('{://([^@]+?):(.+?)@}', '://', $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);
|
$this->runCommand($commandCallable, $url, $dir);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
Loading…
Reference in New Issue