congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
GHRef.delete
Code IndexAdd Tabnine to your IDE (free)

How to use
delete
method
in
org.kohsuke.github.GHRef

Best Java code snippets using org.kohsuke.github.GHRef.delete (Showing top 2 results out of 315)

origin: io.jenkins.updatebot/updatebot-core

public static void deleteUpdateBotBranch(GHRepository ghRepository, String branchName) throws IOException {
  if (branchName.startsWith("updatebot-")) {
    //delete as per https://github.com/kohsuke/github-api/pull/164#issuecomment-78391771
    //heads needed as per https://developer.github.com/v3/git/refs/#get-a-reference
    ghRepository.getRef("heads/" + branchName).delete();
    LOG.info("deleted branch " + branchName + " for " + ghRepository.getFullName());
  }
}
origin: jenkinsci/ghprb-plugin

private void deleteBranch(Run<?, ?> build, Launcher launcher, final TaskListener listener) {
  if (!getDeleteOnMerge()) {
    return;
  }
  String branchName = pr.getHead().getRef();
  try {
    GHRepository repo = pr.getRepository();
    GHRef ref = repo.getRef("heads/" + branchName);
    ref.delete();
    listener.getLogger().println("Deleted branch " + branchName);
  } catch (IOException e) {
    listener.getLogger().println("Unable to delete branch " + branchName);
    e.printStackTrace(listener.getLogger());
  }
}
org.kohsuke.githubGHRefdelete

Javadoc

Deletes this ref from the repository using the GitHub API.

Popular methods of GHRef

  • getObject
    The object that this ref points to.
  • updateTo
    Updates this ref to the specified commit.
  • wrap

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Option (scala)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now