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:
@@ -50,8 +50,10 @@ public class CommentSender extends ReplyToChangeSender {
|
|||||||
Set<String> paths = new HashSet<String>();
|
Set<String> paths = new HashSet<String>();
|
||||||
for (PatchLineComment c : plc) {
|
for (PatchLineComment c : plc) {
|
||||||
Patch.Key p = c.getKey().getParentKey();
|
Patch.Key p = c.getKey().getParentKey();
|
||||||
|
if (!Patch.COMMIT_MSG.equals(p.getFileName())) {
|
||||||
paths.add(p.getFileName());
|
paths.add(p.getFileName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
changeData.setCurrentFilePaths(paths);
|
changeData.setCurrentFilePaths(paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
package com.google.gerrit.server.query.change;
|
package com.google.gerrit.server.query.change;
|
||||||
|
|
||||||
import com.google.gerrit.reviewdb.Change;
|
import com.google.gerrit.reviewdb.Change;
|
||||||
|
import com.google.gerrit.reviewdb.Patch;
|
||||||
import com.google.gerrit.reviewdb.PatchLineComment;
|
import com.google.gerrit.reviewdb.PatchLineComment;
|
||||||
import com.google.gerrit.reviewdb.PatchSet;
|
import com.google.gerrit.reviewdb.PatchSet;
|
||||||
import com.google.gerrit.reviewdb.PatchSetApproval;
|
import com.google.gerrit.reviewdb.PatchSetApproval;
|
||||||
@@ -71,6 +72,9 @@ public class ChangeData {
|
|||||||
PatchList p = cache.get(c, ps);
|
PatchList p = cache.get(c, ps);
|
||||||
List<String> r = new ArrayList<String>(p.getPatches().size());
|
List<String> r = new ArrayList<String>(p.getPatches().size());
|
||||||
for (PatchListEntry e : p.getPatches()) {
|
for (PatchListEntry e : p.getPatches()) {
|
||||||
|
if (Patch.COMMIT_MSG.equals(e.getNewName())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
switch (e.getChangeType()) {
|
switch (e.getChangeType()) {
|
||||||
case ADDED:
|
case ADDED:
|
||||||
case MODIFIED:
|
case MODIFIED:
|
||||||
|
Reference in New Issue
Block a user