Merge branch 'stable-2.15'

* stable-2.15:
  Detect RawInput correctly
  Remove unnecessary 'algorithm' parameter of PatchListKey
  Remove some more false negatives for edits due to rebase
  Remove some false negatives for edits due to rebase

Change-Id: I1a95b209c2091d4993e7cc590f5177a877136be5
This commit is contained in:
Alice Kober-Sotzek
2018-04-04 10:13:45 +02:00
11 changed files with 223 additions and 66 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.server.patch;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.collect.ImmutableSet;
import com.google.gerrit.common.data.CommentDetail;
import com.google.gerrit.common.data.PatchScript;
import com.google.gerrit.common.data.PatchScript.DisplayMethod;
@@ -135,6 +136,7 @@ class PatchScriptBuilder {
b.resolve(a, bId);
edits = new ArrayList<>(content.getEdits());
ImmutableSet<Edit> editsDueToRebase = content.getEditsDueToRebase();
if (!isModify(content)) {
intralineDifferenceIsPossible = false;
@@ -142,7 +144,8 @@ class PatchScriptBuilder {
IntraLineDiff d =
patchListCache.getIntraLineDiff(
IntraLineDiffKey.create(a.id, b.id, diffPrefs.ignoreWhitespace),
IntraLineDiffArgs.create(a.src, b.src, edits, projectKey, bId, b.path));
IntraLineDiffArgs.create(
a.src, b.src, edits, editsDueToRebase, projectKey, bId, b.path));
if (d != null) {
switch (d.getStatus()) {
case EDIT_LIST:
@@ -214,7 +217,7 @@ class PatchScriptBuilder {
a.dst,
b.dst,
edits,
content.getEditsDueToRebase(),
editsDueToRebase,
a.displayMethod,
b.displayMethod,
a.mimeType.toString(),