title: How to remove remote branch with JGit
body: <p>I'm not able to figure out how to remove a remote branch.</p>
  
  <p>I was trying to mimic the following GIT command:
      git push origin :branchToDelete</p>
  
  <p>The following code and it's variations with the empty source:   </p>
  
  <pre><code>RefSpec refSpec = new RefSpec();
  refSpec = refSpec.setSource("");
  // remove branch from origin:
  git.push().setRefSpecs(refSpec).add(branchToDelete).call();
  </code></pre>
  
  <p>throws and exception like:</p>
  
  <pre><code>org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of push command
      at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:175)
      at org.gitscripts.DeleteBranchOperation.execute(DeleteBranchOperation.java:27)
      at org.gitscripts.Main.main(Main.java:27)
  Caused by: java.io.IOException: Source ref  doesnt resolve to any object.
      at org.eclipse.jgit.transport.RemoteRefUpdate.&lt;init&gt;(RemoteRefUpdate.java:285)
      at org.eclipse.jgit.transport.RemoteRefUpdate.&lt;init&gt;(RemoteRefUpdate.java:189)
      at org.eclipse.jgit.transport.Transport.findRemoteRefUpdatesFor(Transport.java:612)
      at org.eclipse.jgit.transport.Transport.findRemoteRefUpdatesFor(Transport.java:1150)
      at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:149)
      ... 2 more
  </code></pre>
  
  <p>Thanks in advance for your ideas and solutions.</p>