package com.atlassian.bitbucket.scm.git.command.merge.conflict;

import com.atlassian.bitbucket.content.ChangeType;

import javax.annotation.Nonnull;

/**
 * A merge conflict where the same file has been renamed differently on each side of a merge.
 * @see ConvergentRenameGitMergeConflict
 */
public class DivergentRenameGitMergeConflict extends AbstractGitMergeConflict {

    private final String ourPath;
    private final String srcPath;
    private final String theirPath;

    public DivergentRenameGitMergeConflict(@Nonnull String message, @Nonnull String srcPath,
                                           @Nonnull String ourPath, @Nonnull String theirPath) {
        super(GitMergeConflictType.RENAME_RENAME, message, ChangeType.MOVE);

        this.ourPath = ourPath;
        this.srcPath = srcPath;
        this.theirPath = theirPath;
    }

    @Override
    public void accept(@Nonnull GitMergeConflictVisitor visitor) {
        visitor.visit(this);
    }

    @Nonnull
    public String getOurPath() {
        return ourPath;
    }

    @Nonnull
    public String getSrcPath() {
        return srcPath;
    }

    @Nonnull
    public String getTheirPath() {
        return theirPath;
    }
}
