|
|
@ -51,6 +51,7 @@ import org.eclipse.jgit.api.Git; |
|
|
|
import org.eclipse.jgit.api.MergeCommand; |
|
|
|
import org.eclipse.jgit.api.MergeCommand; |
|
|
|
import org.eclipse.jgit.api.MergeResult; |
|
|
|
import org.eclipse.jgit.api.MergeResult; |
|
|
|
import org.eclipse.jgit.api.MergeCommand.FastForwardMode; |
|
|
|
import org.eclipse.jgit.api.MergeCommand.FastForwardMode; |
|
|
|
|
|
|
|
import org.eclipse.jgit.api.errors.CheckoutConflictException; |
|
|
|
import org.eclipse.jgit.lib.AnyObjectId; |
|
|
|
import org.eclipse.jgit.lib.AnyObjectId; |
|
|
|
import org.eclipse.jgit.lib.Constants; |
|
|
|
import org.eclipse.jgit.lib.Constants; |
|
|
|
import org.eclipse.jgit.lib.ObjectId; |
|
|
|
import org.eclipse.jgit.lib.ObjectId; |
|
|
@ -119,7 +120,12 @@ class Merge extends TextBuiltin { |
|
|
|
mergeCmd.include(srcRef); |
|
|
|
mergeCmd.include(srcRef); |
|
|
|
else |
|
|
|
else |
|
|
|
mergeCmd.include(src); |
|
|
|
mergeCmd.include(src); |
|
|
|
MergeResult result = mergeCmd.call(); |
|
|
|
MergeResult result; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
result = mergeCmd.call(); |
|
|
|
|
|
|
|
} catch (CheckoutConflictException e) { |
|
|
|
|
|
|
|
result = new MergeResult(e.getConflictingPaths()); // CHECKOUT_CONFLICT
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (result.getMergeStatus()) { |
|
|
|
switch (result.getMergeStatus()) { |
|
|
|
case ALREADY_UP_TO_DATE: |
|
|
|
case ALREADY_UP_TO_DATE: |
|
|
@ -134,6 +140,12 @@ class Merge extends TextBuiltin { |
|
|
|
.name())); |
|
|
|
.name())); |
|
|
|
outw.println(result.getMergeStatus().toString()); |
|
|
|
outw.println(result.getMergeStatus().toString()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case CHECKOUT_CONFLICT: |
|
|
|
|
|
|
|
outw.println(CLIText.get().mergeCheckoutConflict); |
|
|
|
|
|
|
|
for (String collidingPath : result.getCheckoutConflicts()) |
|
|
|
|
|
|
|
outw.println("\t" + collidingPath); //$NON-NLS-1$
|
|
|
|
|
|
|
|
outw.println(CLIText.get().mergeCheckoutFailed); |
|
|
|
|
|
|
|
break; |
|
|
|
case CONFLICTING: |
|
|
|
case CONFLICTING: |
|
|
|
for (String collidingPath : result.getConflicts().keySet()) |
|
|
|
for (String collidingPath : result.getConflicts().keySet()) |
|
|
|
outw.println(MessageFormat.format(CLIText.get().mergeConflict, |
|
|
|
outw.println(MessageFormat.format(CLIText.get().mergeConflict, |
|
|
|