Merge "Do not categorize merge failures as 'abnormal'"
This commit is contained in:
commit
c8b698abb9
|
@ -147,7 +147,7 @@ public CherryPickResult call() throws GitAPIException {
|
||||||
.setAuthor(srcCommit.getAuthorIdent()).call();
|
.setAuthor(srcCommit.getAuthorIdent()).call();
|
||||||
cherryPickedRefs.add(src);
|
cherryPickedRefs.add(src);
|
||||||
} else {
|
} else {
|
||||||
if (merger.failedAbnormally())
|
if (merger.failed())
|
||||||
return new CherryPickResult(merger.getFailingPaths());
|
return new CherryPickResult(merger.getFailingPaths());
|
||||||
|
|
||||||
// merge conflicts
|
// merge conflicts
|
||||||
|
|
|
@ -103,7 +103,7 @@ public CherryPickResult(RevCommit newHead, List<Ref> cherryPickedRefs) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param failingPaths
|
* @param failingPaths
|
||||||
* list of paths causing this cherry-pick to fail abnormally (see
|
* list of paths causing this cherry-pick to fail (see
|
||||||
* {@link ResolveMerger#getFailingPaths()} for details)
|
* {@link ResolveMerger#getFailingPaths()} for details)
|
||||||
*/
|
*/
|
||||||
public CherryPickResult(Map<String, MergeFailureReason> failingPaths) {
|
public CherryPickResult(Map<String, MergeFailureReason> failingPaths) {
|
||||||
|
@ -153,8 +153,8 @@ public List<Ref> getCherryPickedRefs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the list of paths causing this cherry-pick to fail abnormally
|
* @return the list of paths causing this cherry-pick to fail (see
|
||||||
* (see {@link ResolveMerger#getFailingPaths()} for details),
|
* {@link ResolveMerger#getFailingPaths()} for details),
|
||||||
* <code>null</code> if {@link #getStatus} is not
|
* <code>null</code> if {@link #getStatus} is not
|
||||||
* {@link CherryPickStatus#FAILED}
|
* {@link CherryPickStatus#FAILED}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -187,8 +187,8 @@ public MergeResult(ObjectId newHead, ObjectId base,
|
||||||
* merge results as returned by
|
* merge results as returned by
|
||||||
* {@link ResolveMerger#getMergeResults()}
|
* {@link ResolveMerger#getMergeResults()}
|
||||||
* @param failingPaths
|
* @param failingPaths
|
||||||
* list of paths causing this merge to fail abnormally as
|
* list of paths causing this merge to fail as returned by
|
||||||
* returned by {@link ResolveMerger#getFailingPaths()}
|
* {@link ResolveMerger#getFailingPaths()}
|
||||||
* @param description
|
* @param description
|
||||||
* a user friendly description of the merge result
|
* a user friendly description of the merge result
|
||||||
*/
|
*/
|
||||||
|
@ -356,11 +356,11 @@ public Map<String, int[][]> getConflicts() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of paths causing this merge to fail abnormally as returned
|
* Returns a list of paths causing this merge to fail as returned by
|
||||||
* by {@link ResolveMerger#getFailingPaths()}
|
* {@link ResolveMerger#getFailingPaths()}
|
||||||
*
|
*
|
||||||
* @return the list of paths causing this merge to fail abnormally or
|
* @return the list of paths causing this merge to fail or <code>null</code>
|
||||||
* <code>null</code> if no abnormal failure occurred
|
* if no failure occurred
|
||||||
*/
|
*/
|
||||||
public Map<String, MergeFailureReason> getFailingPaths() {
|
public Map<String, MergeFailureReason> getFailingPaths() {
|
||||||
return failingPaths;
|
return failingPaths;
|
||||||
|
|
|
@ -109,9 +109,9 @@ public enum Status {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create <code>RebaseResult</code> with status {@link Status#FAILED}
|
* Create <code>RebaseResult</code> with status {@link Status#FAILED}
|
||||||
*
|
*
|
||||||
* @param failingPaths
|
* @param failingPaths
|
||||||
* list of paths causing this rebase to fail abnormally
|
* list of paths causing this rebase to fail
|
||||||
*/
|
*/
|
||||||
RebaseResult(Map<String, MergeFailureReason> failingPaths) {
|
RebaseResult(Map<String, MergeFailureReason> failingPaths) {
|
||||||
mySatus = Status.FAILED;
|
mySatus = Status.FAILED;
|
||||||
|
@ -135,7 +135,7 @@ public RevCommit getCurrentCommit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the list of paths causing this rebase to fail abnormally (see
|
* @return the list of paths causing this rebase to fail (see
|
||||||
* {@link ResolveMerger#getFailingPaths()} for details) if status is
|
* {@link ResolveMerger#getFailingPaths()} for details) if status is
|
||||||
* {@link Status#FAILED}, otherwise <code>null</code>
|
* {@link Status#FAILED}, otherwise <code>null</code>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -90,8 +90,8 @@
|
||||||
*/
|
*/
|
||||||
public class ResolveMerger extends ThreeWayMerger {
|
public class ResolveMerger extends ThreeWayMerger {
|
||||||
/**
|
/**
|
||||||
* If the merge fails abnormally (means: not because of unresolved
|
* If the merge fails (means: not stopped because of unresolved conflicts)
|
||||||
* conflicts) this enum is used to explain why it failed
|
* this enum is used to explain why it failed
|
||||||
*/
|
*/
|
||||||
public enum MergeFailureReason {
|
public enum MergeFailureReason {
|
||||||
/** the merge failed because of a dirty index */
|
/** the merge failed because of a dirty index */
|
||||||
|
@ -629,22 +629,22 @@ public Map<String, MergeResult<? extends Sequence>> getMergeResults() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return lists paths causing this merge to fail abnormally (not because of
|
* @return lists paths causing this merge to fail (not stopped because of a
|
||||||
* a conflict). <code>null</code> is returned if this merge didn't
|
* conflict). <code>null</code> is returned if this merge didn't
|
||||||
* fail abnormally.
|
* fail.
|
||||||
*/
|
*/
|
||||||
public Map<String, MergeFailureReason> getFailingPaths() {
|
public Map<String, MergeFailureReason> getFailingPaths() {
|
||||||
return (failingPaths.size() == 0) ? null : failingPaths;
|
return (failingPaths.size() == 0) ? null : failingPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this merge failed abnormally (i.e. not because of a
|
* Returns whether this merge failed (i.e. not stopped because of a
|
||||||
* conflict)
|
* conflict)
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if an abnormal failure occurred,
|
* @return <code>true</code> if a failure occurred, <code>false</code>
|
||||||
* <code>false</code> otherwise
|
* otherwise
|
||||||
*/
|
*/
|
||||||
public boolean failedAbnormally() {
|
public boolean failed() {
|
||||||
return failingPaths.size() > 0;
|
return failingPaths.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue