mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-24 01:09:48 +01:00
Adds 'head' as revision for Subversion repositories
To still support the editor plugin, a new field in the browse command results is needed to indicate, whether such a result or rather the requested revision can be modified by a new commit. This is the case, when - for Subversion repositories either the new 'head' or the latest revision has been requested, or - for Git and HG when a branch (or the default by specifying no concrete revision) has been used.
This commit is contained in:
@@ -54,11 +54,27 @@ public class GitBrowseCommandTest extends AbstractGitCommandTestBase {
|
||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||
request.setPath("a.txt");
|
||||
BrowserResult result = createCommand().getBrowserResult(request);
|
||||
assertTrue(result.isModifiable());
|
||||
assertEquals("HEAD", result.getRequestedRevision());
|
||||
FileObject fileObject = result.getFile();
|
||||
assertEquals("a.txt", fileObject.getName());
|
||||
assertFalse(fileObject.isTruncated());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDifferentBranch() throws IOException {
|
||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||
request.setRevision("test-branch");
|
||||
|
||||
BrowserResult result = createCommand().getBrowserResult(request);
|
||||
|
||||
assertTrue(result.isModifiable());
|
||||
Collection<FileObject> foList = result.getFile().getChildren();
|
||||
assertThat(foList)
|
||||
.extracting("name")
|
||||
.containsExactly("c", "a.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultDefaultBranch() throws IOException {
|
||||
// without default branch, the repository head should be used
|
||||
|
||||
Reference in New Issue
Block a user