check first if there are changes

main
Ricard Clau 11 years ago
parent 48ac383599
commit 56f4625ec8

@ -90,6 +90,10 @@ class GitDownloader extends VcsDownloader
*/
protected function cleanChanges($path, $update)
{
if (!$changes = $this->getLocalChanges($path)) {
return;
}
$discardChanges = $this->config->get('discard-changes');
if (!$this->io->isInteractive()) {
switch ($discardChanges) {
@ -109,10 +113,6 @@ class GitDownloader extends VcsDownloader
}
}
if (!$changes = $this->getLocalChanges($path)) {
return;
}
$changes = array_map(function ($elem) {
return ' '.$elem;
}, preg_split('{\s*\r?\n\s*}', $changes));

@ -88,6 +88,10 @@ class SvnDownloader extends VcsDownloader
*/
protected function cleanChanges($path, $update)
{
if (!$changes = $this->getLocalChanges($path)) {
return;
}
$discardChanges = $this->config->get('discard-changes');
if (!$this->io->isInteractive()) {
switch ($discardChanges) {
@ -101,10 +105,6 @@ class SvnDownloader extends VcsDownloader
}
}
if (!$changes = $this->getLocalChanges($path)) {
return;
}
$changes = array_map(function ($elem) {
return ' '.$elem;
}, preg_split('{\s*\r?\n\s*}', $changes));

Loading…
Cancel
Save