Do not check for changes if there is no vcs dir
In case the package is in a broken state we do not want to show diffs from the main projectpull/1349/merge
parent
c5af2eacf1
commit
18973ed0b9
|
@ -73,6 +73,10 @@ class GitDownloader extends VcsDownloader
|
||||||
*/
|
*/
|
||||||
public function getLocalChanges($path)
|
public function getLocalChanges($path)
|
||||||
{
|
{
|
||||||
|
if (!is_dir($path.'/.git')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$command = sprintf('cd %s && git status --porcelain --untracked-files=no', escapeshellarg($path));
|
$command = sprintf('cd %s && git status --porcelain --untracked-files=no', escapeshellarg($path));
|
||||||
if (0 !== $this->process->execute($command, $output)) {
|
if (0 !== $this->process->execute($command, $output)) {
|
||||||
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
||||||
|
|
|
@ -54,6 +54,10 @@ class HgDownloader extends VcsDownloader
|
||||||
*/
|
*/
|
||||||
public function getLocalChanges($path)
|
public function getLocalChanges($path)
|
||||||
{
|
{
|
||||||
|
if (!is_dir($path.'/.hg')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
|
$this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
|
||||||
|
|
||||||
return trim($output) ?: null;
|
return trim($output) ?: null;
|
||||||
|
|
|
@ -50,6 +50,10 @@ class SvnDownloader extends VcsDownloader
|
||||||
*/
|
*/
|
||||||
public function getLocalChanges($path)
|
public function getLocalChanges($path)
|
||||||
{
|
{
|
||||||
|
if (!is_dir($path.'/.svn')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->process->execute('svn status --ignore-externals', $output, $path);
|
$this->process->execute('svn status --ignore-externals', $output, $path);
|
||||||
|
|
||||||
return preg_match('{^ *[^X ] +}m', $output) ? $output : null;
|
return preg_match('{^ *[^X ] +}m', $output) ? $output : null;
|
||||||
|
|
Loading…
Reference in New Issue