Skip to content

Commit

Permalink
Indicate, that "Connector::getFileContent" can accept string meta-rev…
Browse files Browse the repository at this point in the history
…ision (e.g. HEAD).
  • Loading branch information
aik099 committed Mar 23, 2024
1 parent 341a20b commit c5816ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SVNBuddy/Repository/Connector/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,8 @@ protected function getMergedRevisions($wc_path, $revision = null)
/**
* Returns file contents at given revision.
*
* @param string $path_or_url Path or url.
* @param integer $revision Revision.
* @param string $path_or_url Path or url.
* @param integer|string $revision Revision.
*
* @return string
*/
Expand Down
8 changes: 8 additions & 0 deletions tests/SVNBuddy/Repository/Connector/ConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,14 @@ public function testGetFileContent()
'OK',
$this->_repositoryConnector->getFileContent('/path/to/working-copy/file.php', 100)
);

$command = $this->_expectCommand('cat', '{/path/to/working-copy/file.php} --revision HEAD', 'OK');
$command->setCacheDuration(Connector::SVN_CAT_CACHE_DURATION)->shouldBeCalled();

$this->assertEquals(
'OK',
$this->_repositoryConnector->getFileContent('/path/to/working-copy/file.php', 'HEAD')
);
}

/**
Expand Down

0 comments on commit c5816ee

Please sign in to comment.