Merge "Fix ArrayIndexOutOfBoundsException on initial commits" into stable-2.8
This commit is contained in:
@@ -370,8 +370,7 @@ public class PatchSetInserter {
|
|||||||
public static ChangeKind getChangeKind(MergeUtil.Factory mergeUtilFactory, ProjectState project,
|
public static ChangeKind getChangeKind(MergeUtil.Factory mergeUtilFactory, ProjectState project,
|
||||||
Repository git, RevCommit prior, RevCommit next) {
|
Repository git, RevCommit prior, RevCommit next) {
|
||||||
if (!next.getFullMessage().equals(prior.getFullMessage())) {
|
if (!next.getFullMessage().equals(prior.getFullMessage())) {
|
||||||
if (next.getTree() == prior.getTree()
|
if (next.getTree() == prior.getTree() && isSameParents(prior, next)) {
|
||||||
&& prior.getParent(0).equals(next.getParent(0))) {
|
|
||||||
return ChangeKind.NO_CODE_CHANGE;
|
return ChangeKind.NO_CODE_CHANGE;
|
||||||
} else {
|
} else {
|
||||||
return ChangeKind.REWORK;
|
return ChangeKind.REWORK;
|
||||||
@@ -384,7 +383,7 @@ public class PatchSetInserter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (next.getTree() == prior.getTree() &&
|
if (next.getTree() == prior.getTree() &&
|
||||||
prior.getParent(0).equals(next.getParent(0))) {
|
isSameParents(prior, next)) {
|
||||||
return ChangeKind.TRIVIAL_REBASE;
|
return ChangeKind.TRIVIAL_REBASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,6 +408,15 @@ public class PatchSetInserter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isSameParents(RevCommit prior, RevCommit next) {
|
||||||
|
if (prior.getParentCount() != next.getParentCount()) {
|
||||||
|
return false;
|
||||||
|
} else if (prior.getParentCount() == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return prior.getParent(0).equals(next.getParent(0));
|
||||||
|
}
|
||||||
|
|
||||||
public class ChangeModifiedException extends InvalidChangeOperationException {
|
public class ChangeModifiedException extends InvalidChangeOperationException {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user