Reject inline comments on files that do not exist in the patch set

Bug: issue 2583
Change-Id: I8df23393bc2d311c46a29fb82bca2fa7bf20488a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-04-10 10:41:45 +02:00
parent d8530c317a
commit dd6748a79f
5 changed files with 49 additions and 20 deletions

View File

@@ -34,6 +34,7 @@ import com.google.gerrit.lifecycle.LifecycleManager;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.Patch;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.CurrentUser;
@@ -721,7 +722,7 @@ public abstract class AbstractQueryChangesTest {
comment.line = 1;
comment.message = "inline";
input.comments = ImmutableMap.<String, List<ReviewInput.Comment>> of(
"Foo.java", ImmutableList.<ReviewInput.Comment> of(comment));
Patch.COMMIT_MSG, ImmutableList.<ReviewInput.Comment> of(comment));
postReview.apply(new RevisionResource(
changes.parse(change.getId()), ins.getPatchSet()), input);

View File

@@ -84,7 +84,7 @@ public class RegexPathPredicateTest {
private static ChangeData change(String... files) throws OrmException {
Arrays.sort(files);
ChangeData cd = ChangeData.createForTest(new Change.Id(1));
ChangeData cd = ChangeData.createForTest(new Change.Id(1), 1);
cd.setCurrentFilePaths(Arrays.asList(files));
return cd;
}