CreateChange: Do not fail with ISE if base commit doesn't exist

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: If2886342815234d385e10d7ba7fe27127229ad4a
This commit is contained in:
Edwin Kempin
2019-10-08 14:33:22 +02:00
parent 00bb743875
commit 1361e9805b
2 changed files with 17 additions and 1 deletions

View File

@@ -277,6 +277,16 @@ public class CreateChangeIT extends AbstractDaemonTest {
input, UnprocessableEntityException.class, "Base notasha1 doesn't represent a valid SHA-1");
}
@Test
public void createChangeWithNonExistingParentCommitFails() throws Exception {
ChangeInput input = newChangeInput(ChangeStatus.NEW);
input.baseCommit = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
assertCreateFails(
input,
UnprocessableEntityException.class,
String.format("Base %s doesn't exist", input.baseCommit));
}
@Test
public void createChangeWithParentCommitOnWrongBranchFails() throws Exception {
Map<String, PushOneCommit.Result> setup =