Liip\RMT\VCS\Git::saveWorkingCopy PHP Method

saveWorkingCopy() public method

public saveWorkingCopy ( $commitMsg = '' )
    public function saveWorkingCopy($commitMsg = '')
    {
        $this->executeGitCommand('add --all');
        // this requires git and gpg configured
        $signOption = isset($this->options['sign-commit']) && $this->options['sign-commit'] ? '-S' : '';
        $this->executeGitCommand("commit {$signOption} -m \"{$commitMsg}\"");
    }

Usage Example

Beispiel #1
0
 public function testSaveWorkingCopy()
 {
     $vcs = new Git();
     $vcs->createTag(new \Liip\RMT\Version('2.0.0'));
     $this->assertEquals(array(), $vcs->getAllModificationsSince('2.0.0'));
     exec('rm file2');
     $vcs->saveWorkingCopy('Remove the second file');
     $this->assertCount(1, $vcs->getAllModificationsSince('2.0.0'));
 }