mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-09 00:27:27 +02:00
Merge with 2.0.0-m3
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class MergeResultDto {
|
||||
private Collection<String> filesWithConflict;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import sonia.scm.repository.api.MergeCommandResult;
|
||||
|
||||
@Mapper
|
||||
public interface MergeResultToDtoMapper {
|
||||
MergeResultDto map(MergeCommandResult result);
|
||||
}
|
||||
@@ -68,6 +68,10 @@ public final class BranchCommandBuilder {
|
||||
return command.branch(request);
|
||||
}
|
||||
|
||||
public void delete(String branchName) {
|
||||
command.deleteOrClose(branchName);
|
||||
}
|
||||
|
||||
private BranchCommand command;
|
||||
private BranchRequest request = new BranchRequest();
|
||||
}
|
||||
|
||||
@@ -41,4 +41,6 @@ import sonia.scm.repository.api.BranchRequest;
|
||||
*/
|
||||
public interface BranchCommand {
|
||||
Branch branch(BranchRequest name);
|
||||
|
||||
void deleteOrClose(String branchName);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import sonia.scm.ContextEntry;
|
||||
import sonia.scm.ExceptionWithContext;
|
||||
import sonia.scm.repository.Repository;
|
||||
|
||||
public class CannotDeleteDefaultBranchException extends ExceptionWithContext {
|
||||
|
||||
public static final String CODE = "78RhWxTIw1";
|
||||
|
||||
public CannotDeleteDefaultBranchException(Repository repository, String branchName) {
|
||||
super(ContextEntry.ContextBuilder.entity("Branch", branchName).in(repository).build(), "default branch cannot be deleted");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
return CODE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user