// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/branch/AbstractGitHubBranchCause.java
// public abstract class AbstractGitHubBranchCause<T extends AbstractGitHubBranchCause<T>> extends GitHubCause<T> {
// 
//     /**
//      * null for deleted branch/tag
//      */
//     @CheckForNull
//     private final String commitSha;
// 
//     @CheckForNull
//     private final String fullRef;
// 
//     protected AbstractGitHubBranchCause(String commitSha, String fullRef) {
//         this.commitSha = commitSha;
//         this.fullRef = fullRef;
//     }
// 
//     /**
//      * Copy constructor
//      */
//     protected AbstractGitHubBranchCause(AbstractGitHubBranchCause<T> cause) {
//         this(cause.getCommitSha(), cause.getFullRef());
//         withGitUrl(cause.getGitUrl());
//         withSshUrl(cause.getSshUrl());
//         withHtmlUrl(cause.getHtmlUrl());
//         withPollingLog(cause.getPollingLog());
//         withReason(cause.getReason());
//         withSkip(cause.isSkip());
//         withTitle(cause.getTitle());
//     }
// 
//     @CheckForNull
//     public String getCommitSha() {
//         return commitSha;
//     }
// 
//     @CheckForNull
//     public String getFullRef() {
//         return fullRef;
//     }
// 
// }
// 
// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubSCMHead.java
// public abstract class GitHubSCMHead<T extends GitHubCause<T>> extends SCMHead {
//     private static final long serialVersionUID = 1L;
// 
//     private final String sourceId;
// 
//     public GitHubSCMHead(@NonNull String name, String sourceId) {
//         super(name);
//         this.sourceId = sourceId;
//     }
// 
//     public String getSourceId() {
//         return sourceId;
//     }
// 
//     public abstract String fetchHeadSha(GHRepository remoteRepo) throws IOException;
// 
//     public abstract String getHeadSha(T cause);
// 
//     public GitHubSCMRevision createSCMRevision(T cause) {
//         return new GitHubSCMRevision(this, getHeadSha(cause), cause);
//     }
// }
// 
// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubTagSCMHead.java
// public class GitHubTagSCMHead extends GitHubSCMHead<GitHubTagCause> {
//     private static final long serialVersionUID = 1L;
// 
//     public GitHubTagSCMHead(@NonNull String name, String sourceId) {
//         super(name, sourceId);
//     }
// 
//     @Override
//     public String getPronoun() {
//         return "Tag " + getName();
//     }
// 
//     @Override
//     public String fetchHeadSha(GHRepository remoteRepo) throws IOException {
//         GHTag tag = GitHubTag.findRemoteTag(remoteRepo, getName());
//         if (tag == null) {
//             throw new IOException("No tag " + getName() + " in " + remoteRepo.getFullName());
//         }
//         return tag.getCommit().getSHA1();
//     }
// 
//     public String getHeadSha(GitHubTagCause cause) {
//         return cause.getCommitSha();
//     }
// }


import com.github.kostyasha.github.integration.branch.AbstractGitHubBranchCause;
import com.github.kostyasha.github.integration.multibranch.head.GitHubSCMHead;
import com.github.kostyasha.github.integration.multibranch.head.GitHubTagSCMHead;
import hudson.model.ParameterValue;
import org.kohsuke.github.GHTag;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.List;
    }

    /**
     * Copy constructor
     */
    public GitHubTagCause(GitHubTagCause cause) {
        super(cause);
        this.tagName = cause.getTagName();
    }

    public String getTagName() {
        return tagName;
    }

    @NonNull
    @Override
    public String getShortDescription() {
        if (getHtmlUrl() != null) {
            return "GitHub tag " + getTagName() + ": " + getReason();
        } else {
            return "Deleted tag";
        }
    }

    @Override
    public void fillParameters(List<ParameterValue> params) {
        GitHubTagEnv.getParams(this, params);
    }

    @Override
// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/branch/AbstractGitHubBranchCause.java
// public abstract class AbstractGitHubBranchCause<T extends AbstractGitHubBranchCause<T>> extends GitHubCause<T> {
// 
//     /**
//      * null for deleted branch/tag
//      */
//     @CheckForNull
//     private final String commitSha;
// 
//     @CheckForNull
//     private final String fullRef;
// 
//     protected AbstractGitHubBranchCause(String commitSha, String fullRef) {
//         this.commitSha = commitSha;
//         this.fullRef = fullRef;
//     }
// 
//     /**
//      * Copy constructor
//      */
//     protected AbstractGitHubBranchCause(AbstractGitHubBranchCause<T> cause) {
//         this(cause.getCommitSha(), cause.getFullRef());
//         withGitUrl(cause.getGitUrl());
//         withSshUrl(cause.getSshUrl());
//         withHtmlUrl(cause.getHtmlUrl());
//         withPollingLog(cause.getPollingLog());
//         withReason(cause.getReason());
//         withSkip(cause.isSkip());
//         withTitle(cause.getTitle());
//     }
// 
//     @CheckForNull
//     public String getCommitSha() {
//         return commitSha;
//     }
// 
//     @CheckForNull
//     public String getFullRef() {
//         return fullRef;
//     }
// 
// }
// 
// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubSCMHead.java
// public abstract class GitHubSCMHead<T extends GitHubCause<T>> extends SCMHead {
//     private static final long serialVersionUID = 1L;
// 
//     private final String sourceId;
// 
//     public GitHubSCMHead(@NonNull String name, String sourceId) {
//         super(name);
//         this.sourceId = sourceId;
//     }
// 
//     public String getSourceId() {
//         return sourceId;
//     }
// 
//     public abstract String fetchHeadSha(GHRepository remoteRepo) throws IOException;
// 
//     public abstract String getHeadSha(T cause);
// 
//     public GitHubSCMRevision createSCMRevision(T cause) {
//         return new GitHubSCMRevision(this, getHeadSha(cause), cause);
//     }
// }
// 
// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubTagSCMHead.java
// public class GitHubTagSCMHead extends GitHubSCMHead<GitHubTagCause> {
//     private static final long serialVersionUID = 1L;
// 
//     public GitHubTagSCMHead(@NonNull String name, String sourceId) {
//         super(name, sourceId);
//     }
// 
//     @Override
//     public String getPronoun() {
//         return "Tag " + getName();
//     }
// 
//     @Override
//     public String fetchHeadSha(GHRepository remoteRepo) throws IOException {
//         GHTag tag = GitHubTag.findRemoteTag(remoteRepo, getName());
//         if (tag == null) {
//             throw new IOException("No tag " + getName() + " in " + remoteRepo.getFullName());
//         }
//         return tag.getCommit().getSHA1();
//     }
// 
//     public String getHeadSha(GitHubTagCause cause) {
//         return cause.getCommitSha();
//     }
// }


// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/tag/GitHubTagCause.java
import com.github.kostyasha.github.integration.branch.AbstractGitHubBranchCause;
import com.github.kostyasha.github.integration.multibranch.head.GitHubSCMHead;
import com.github.kostyasha.github.integration.multibranch.head.GitHubTagSCMHead;
import hudson.model.ParameterValue;
import org.kohsuke.github.GHTag;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.List;

    }

    /**
     * Copy constructor
     */
    public GitHubTagCause(GitHubTagCause cause) {
        super(cause);
        this.tagName = cause.getTagName();
    }

    public String getTagName() {
        return tagName;
    }

    @NonNull
    @Override
    public String getShortDescription() {
        if (getHtmlUrl() != null) {
            return "GitHub tag " + getTagName() + ": " + getReason();
        } else {
            return "Deleted tag";
        }
    }

    @Override
    public void fillParameters(List<ParameterValue> params) {
        GitHubTagEnv.getParams(this, params);
    }

    @Override
    public GitHubSCMHead<GitHubTagCause> createSCMHead(String sourceId) {