mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
Minor changes due to review
This commit is contained in:
@@ -29,11 +29,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.api;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -49,7 +46,6 @@ import sonia.scm.repository.spi.BranchesCommand;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The branches command list all repository branches.<br />
|
||||
|
||||
@@ -56,10 +56,8 @@ public class BranchRootResource {
|
||||
@ResponseCode(code = 500, condition = "internal server error")
|
||||
})
|
||||
public Response get(@PathParam("namespace") String namespace, @PathParam("name") String name, @PathParam("branch") String branchName) throws IOException, RepositoryException {
|
||||
System.out.println("in branch resource");
|
||||
try (RepositoryService repositoryService = servicefactory.create(new NamespaceAndName(namespace, name))) {
|
||||
Branches branches = repositoryService.getBranchesCommand().getBranches();
|
||||
System.out.println("found branches: " + branches);
|
||||
return branches.getBranches()
|
||||
.stream()
|
||||
.filter(branch -> branchName.equals(branch.getName()))
|
||||
@@ -71,7 +69,6 @@ public class BranchRootResource {
|
||||
} catch (CommandNotSupportedException ex) {
|
||||
return Response.status(Response.Status.BAD_REQUEST).build();
|
||||
} catch (RepositoryNotFoundException e) {
|
||||
System.out.println("got RepositoryNotFoundException");
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
}
|
||||
@@ -79,7 +76,7 @@ public class BranchRootResource {
|
||||
@Path("{branch}/changesets/")
|
||||
@GET
|
||||
public Response history(@PathParam("namespace") String namespace, @PathParam("name") String name, @PathParam("branch") String branchName) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -138,7 +138,6 @@ public class RepositoryResource {
|
||||
|
||||
@Path("branches/")
|
||||
public BranchRootResource branches(@PathParam("namespace") String namespace, @PathParam("name") String name) {
|
||||
System.out.println("got request for branches");
|
||||
return branchRootResource.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,6 @@ import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.any;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Unit tests for {@link BearerRealm}.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user