mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-22 20:11:38 +01:00
Add conflict type
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import static sonia.scm.repository.spi.MergeConflictResult.ConflictTypes.ADDED_BY_BOTH;
|
||||
import static sonia.scm.repository.spi.MergeConflictResult.ConflictTypes.BOTH_MODIFIED;
|
||||
import static sonia.scm.repository.spi.MergeConflictResult.ConflictTypes.DELETED_BY_THEM;
|
||||
import static sonia.scm.repository.spi.MergeConflictResult.ConflictTypes.DELETED_BY_US;
|
||||
@@ -28,6 +29,10 @@ public class MergeConflictResult {
|
||||
conflicts.add(new SingleMergeConflict(DELETED_BY_US, path, null));
|
||||
}
|
||||
|
||||
public void addAddedByBoth(String path) {
|
||||
conflicts.add(new SingleMergeConflict(ADDED_BY_BOTH, path, null));
|
||||
}
|
||||
|
||||
public static class SingleMergeConflict {
|
||||
private final ConflictTypes type;
|
||||
private final String path;
|
||||
@@ -53,6 +58,6 @@ public class MergeConflictResult {
|
||||
}
|
||||
|
||||
public enum ConflictTypes {
|
||||
BOTH_MODIFIED, DELETED_BY_THEM, DELETED_BY_US
|
||||
BOTH_MODIFIED, DELETED_BY_THEM, DELETED_BY_US, ADDED_BY_BOTH
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +142,9 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
|
||||
throw new InternalRepositoryException(repository, "could not calculate diff for path " + path, e);
|
||||
}
|
||||
break;
|
||||
case BOTH_ADDED:
|
||||
result.addAddedByBoth(path);
|
||||
break;
|
||||
case DELETED_BY_THEM:
|
||||
result.addDeletedByThem(path);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user