Don't expose /COMMIT_MSG as a modified file in ChangeData

We don't want uses to pattern match "file:^/COMMIT_MSG", because
every single change contains it.

Change-Id: Ib47af2ad97950d7a3f7326d743a9b01fb11866d4
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-08-21 14:15:08 -07:00
parent d3d95abd32
commit f08f586e7b
2 changed files with 7 additions and 1 deletions

View File

@@ -50,8 +50,10 @@ public class CommentSender extends ReplyToChangeSender {
Set<String> paths = new HashSet<String>();
for (PatchLineComment c : plc) {
Patch.Key p = c.getKey().getParentKey();
if (!Patch.COMMIT_MSG.equals(p.getFileName())) {
paths.add(p.getFileName());
}
}
changeData.setCurrentFilePaths(paths);
}

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.server.query.change;
import com.google.gerrit.reviewdb.Change;
import com.google.gerrit.reviewdb.Patch;
import com.google.gerrit.reviewdb.PatchLineComment;
import com.google.gerrit.reviewdb.PatchSet;
import com.google.gerrit.reviewdb.PatchSetApproval;
@@ -71,6 +72,9 @@ public class ChangeData {
PatchList p = cache.get(c, ps);
List<String> r = new ArrayList<String>(p.getPatches().size());
for (PatchListEntry e : p.getPatches()) {
if (Patch.COMMIT_MSG.equals(e.getNewName())) {
continue;
}
switch (e.getChangeType()) {
case ADDED:
case MODIFIED: