|
@@ -267,21 +267,29 @@ class GitDownloaderTest extends TestCase
|
|
|
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
$processExecutor->expects($this->at(0))
|
|
|
->method('execute')
|
|
|
- ->with($this->equalTo($this->winCompat("git status --porcelain --untracked-files=no")))
|
|
|
+ ->with($this->equalTo($this->winCompat("git rev-parse --abbrev-ref HEAD")))
|
|
|
->will($this->returnValue(0));
|
|
|
$processExecutor->expects($this->at(1))
|
|
|
->method('execute')
|
|
|
- ->with($this->equalTo($this->winCompat("git remote -v")))
|
|
|
+ ->with($this->equalTo($this->winCompat("git diff --name-status ..composer/")))
|
|
|
->will($this->returnValue(0));
|
|
|
$processExecutor->expects($this->at(2))
|
|
|
->method('execute')
|
|
|
- ->with($this->equalTo($expectedGitUpdateCommand))
|
|
|
+ ->with($this->equalTo($this->winCompat("git status --porcelain --untracked-files=no")))
|
|
|
->will($this->returnValue(0));
|
|
|
$processExecutor->expects($this->at(3))
|
|
|
->method('execute')
|
|
|
- ->with($this->equalTo('git branch -r'))
|
|
|
+ ->with($this->equalTo($this->winCompat("git remote -v")))
|
|
|
->will($this->returnValue(0));
|
|
|
$processExecutor->expects($this->at(4))
|
|
|
+ ->method('execute')
|
|
|
+ ->with($this->equalTo($this->winCompat($expectedGitUpdateCommand)), $this->equalTo(null), $this->equalTo($this->winCompat($this->workingDir)))
|
|
|
+ ->will($this->returnValue(0));
|
|
|
+ $processExecutor->expects($this->at(5))
|
|
|
+ ->method('execute')
|
|
|
+ ->with($this->equalTo('git branch -r'))
|
|
|
+ ->will($this->returnValue(0));
|
|
|
+ $processExecutor->expects($this->at(6))
|
|
|
->method('execute')
|
|
|
->with($this->equalTo($this->winCompat("git checkout 'ref' -- && git reset --hard 'ref' --")), $this->equalTo(null), $this->equalTo($this->winCompat($this->workingDir)))
|
|
|
->will($this->returnValue(0));
|
|
@@ -309,13 +317,21 @@ class GitDownloaderTest extends TestCase
|
|
|
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
$processExecutor->expects($this->at(0))
|
|
|
->method('execute')
|
|
|
- ->with($this->equalTo($this->winCompat("git status --porcelain --untracked-files=no")))
|
|
|
+ ->with($this->equalTo($this->winCompat("git rev-parse --abbrev-ref HEAD")))
|
|
|
->will($this->returnValue(0));
|
|
|
$processExecutor->expects($this->at(1))
|
|
|
->method('execute')
|
|
|
- ->with($this->equalTo($this->winCompat("git remote -v")))
|
|
|
+ ->with($this->equalTo($this->winCompat("git diff --name-status ..composer/")))
|
|
|
->will($this->returnValue(0));
|
|
|
$processExecutor->expects($this->at(2))
|
|
|
+ ->method('execute')
|
|
|
+ ->with($this->equalTo($this->winCompat("git status --porcelain --untracked-files=no")))
|
|
|
+ ->will($this->returnValue(0));
|
|
|
+ $processExecutor->expects($this->at(3))
|
|
|
+ ->method('execute')
|
|
|
+ ->with($this->equalTo($this->winCompat("git remote -v")))
|
|
|
+ ->will($this->returnValue(0));
|
|
|
+ $processExecutor->expects($this->at(4))
|
|
|
->method('execute')
|
|
|
->with($this->equalTo($expectedGitUpdateCommand))
|
|
|
->will($this->returnValue(1));
|