mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-26 17:29:12 +01:00
Remove unnecessary check
This commit is contained in:
@@ -79,9 +79,6 @@ class HgFileviewCommandResultReader {
|
||||
|
||||
private boolean isParent(FileObject parent, FileObject child) {
|
||||
String parentPath = parent.getPath();
|
||||
if (parentPath.equals("")) {
|
||||
return true;
|
||||
}
|
||||
return child.getParentPath().equals(parentPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,22 @@ class HgFileviewCommandResultReaderTest {
|
||||
assertThat(fileObject.isTruncated()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldParseSubDirectory() throws IOException {
|
||||
HgFileviewCommandResultReader reader = new MockInput()
|
||||
.dir("dir")
|
||||
.file("dir/a.txt")
|
||||
.build();
|
||||
|
||||
FileObject fileObject = reader.parseResult();
|
||||
|
||||
assertThat(fileObject.isDirectory()).isTrue();
|
||||
assertThat(fileObject.getName()).isEqualTo("dir");
|
||||
assertThat(fileObject.getChildren())
|
||||
.extracting("name")
|
||||
.containsExactly("a.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldParseRecursiveResult() throws IOException {
|
||||
HgFileviewCommandResultReader reader = new MockInput()
|
||||
|
||||
Reference in New Issue
Block a user