Bug 395628 - PushCommand to delete remote branch differs from command line
Summary: PushCommand to delete remote branch differs from command line
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-12-03 11:44 EST by Rüdiger Herrmann CLA
Modified: 2014-04-25 18:16 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2012-12-03 11:44:50 EST
If the PushCommand is configured to delete a remote branch, it behaves different from the Git command line.
Given there is a local branch 'foo' that tracks a remote brach with the same name, this code snippet:
  PushCommand pushCommand = ...
  pushCommand.setRemote( "origin" );
  pushCommand.add( ":foo" );
  pushCommand.call();
deletes the 'foo' branch on the remote repository *and* locally.

Whereas 'git push origin :foo' from the command line leaves the local branch 'foo' intact.