mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
Add recursive deletion in modify command (#1821)
Adds a method in the ModifyCommand to delete not only files, but also directories recursively.
This commit is contained in:
@@ -77,7 +77,7 @@ public class SvnModifyCommandTest extends AbstractSvnCommandTestBase {
|
||||
@Test
|
||||
public void shouldRemoveFiles() {
|
||||
ModifyCommandRequest request = new ModifyCommandRequest();
|
||||
request.addRequest(new ModifyCommandRequest.DeleteFileRequest("a.txt"));
|
||||
request.addRequest(new ModifyCommandRequest.DeleteFileRequest("a.txt", false));
|
||||
request.setCommitMessage("this is great");
|
||||
request.setAuthor(new Person("Arthur Dent", "dent@hitchhiker.com"));
|
||||
|
||||
@@ -87,6 +87,19 @@ public class SvnModifyCommandTest extends AbstractSvnCommandTestBase {
|
||||
assertThat(new File(workingCopy.getWorkingRepository().getAbsolutePath() + "/c")).exists();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRemoveDirectory() {
|
||||
ModifyCommandRequest request = new ModifyCommandRequest();
|
||||
request.addRequest(new ModifyCommandRequest.DeleteFileRequest("c", true));
|
||||
request.setCommitMessage("this is great");
|
||||
request.setAuthor(new Person("Arthur Dent", "dent@hitchhiker.com"));
|
||||
|
||||
svnModifyCommand.execute(request);
|
||||
WorkingCopy<File, File> workingCopy = workingCopyFactory.createWorkingCopy(context, null);
|
||||
assertThat(new File(workingCopy.getWorkingRepository().getAbsolutePath() + "/a.txt")).exists();
|
||||
assertThat(new File(workingCopy.getWorkingRepository().getAbsolutePath() + "/c")).doesNotExist();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldAddNewFile() throws IOException {
|
||||
File testfile = temporaryFolder.newFile("Test123");
|
||||
|
||||
Reference in New Issue
Block a user