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

import com.atlassian.bitbucket.content.ChangeType;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * @see DeleteRenameGitMergeConflict
 */
public class RenameDeleteGitMergeConflict extends AbstractPathGitMergeConflict {

    private final String ourSrcPath;

    public RenameDeleteGitMergeConflict(@Nonnull String message, @Nonnull String path) {
        this(message, path, null);
    }

    public RenameDeleteGitMergeConflict(@Nonnull String message, @Nonnull String path, @Nullable String ourSrcPath) {
        super(GitMergeConflictType.RENAME_DELETE, message, ChangeType.MOVE, ChangeType.DELETE, path);

        this.ourSrcPath = ourSrcPath;
    }

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

    @Nullable
    public String getOurSrcPath() {
        return ourSrcPath;
    }
}
