mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
Throw not found exceptions for log between branches
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import org.junit.Test;
|
||||
import sonia.scm.NotFoundException;
|
||||
import sonia.scm.repository.ChangesetPagingResult;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -95,6 +96,28 @@ public class GitLogCommandAncestorTest extends AbstractGitCommandTestBase
|
||||
assertEquals("201ecc1131e6b99fb0a0fe9dcbc8c044383e1a07", result.getChangesets().get(6).getId());
|
||||
}
|
||||
|
||||
@Test(expected = NotFoundException.class)
|
||||
public void testAncestorWithDeletedSourceBranch()
|
||||
{
|
||||
LogCommandRequest request = new LogCommandRequest();
|
||||
|
||||
request.setBranch("no_such_branch");
|
||||
request.setAncestorChangeset("master");
|
||||
|
||||
createCommand().getChangesets(request);
|
||||
}
|
||||
|
||||
@Test(expected = NotFoundException.class)
|
||||
public void testAncestorWithDeletedAncestorBranch()
|
||||
{
|
||||
LogCommandRequest request = new LogCommandRequest();
|
||||
|
||||
request.setBranch("b");
|
||||
request.setAncestorChangeset("no_such_branch");
|
||||
|
||||
createCommand().getChangesets(request);
|
||||
}
|
||||
|
||||
private GitLogCommand createCommand()
|
||||
{
|
||||
return new GitLogCommand(createContext(), repository);
|
||||
|
||||
Reference in New Issue
Block a user