diff options
author | Leandro Lucarella <leandro.lucarella@sociomantic.com> | 2015-04-09 17:35:19 +0200 |
---|---|---|
committer | Mihails Strasuns <mihails.strasuns.contractor@sociomantic.com> | 2015-04-10 14:10:16 +0300 |
commit | cdad1b2d627d4a1cf679d0be4232353d3dd6e0c9 (patch) | |
tree | eac4fe9c3b2df6b5e71d332663202ce4356976d1 | |
parent | eda9b2631f36f7474ba1610284370a67d2ba914e (diff) |
Add a pull rebase --delete-branch option
This emulates the "Delete Branch" button in GitHub's web interface.
Fixes #129.
-rwxr-xr-x | git-hub | 9 | ||||
-rw-r--r-- | man.rst | 5 |
2 files changed, 14 insertions, 0 deletions
@@ -1492,6 +1492,10 @@ class RebaseCmd (PullUtil): action='store_true', default=False, help="uses git stash save --all when stashing local " "changes") + parser.add_argument('-D', '--delete-branch', + action='store_true', default=False, + help="removes the PR branch, like the Delete " + "Branch button (TM)") @classmethod def run(cls, parser, args): @@ -1757,6 +1761,11 @@ class RebaseCmd (PullUtil): base_ref, base_url) git_push(base_url, 'HEAD:' + base_ref, force=args.force_push) + if args.delete_branch: + infof('Removing pull request branch {} in {}', + head_ref, head_url) + git_push(head_url, ':' + head_ref, + force=args.force_push) return git('rev-parse HEAD') finally: if not cls.in_conflict and not cls.in_pause: @@ -363,6 +363,11 @@ COMMANDS cleaned in addition to the untracked files, which completely removes the possibility of conflicts when checking out the pull request to reabase. + \-D, --delete-branch + Delete the pull request branch if the rebase was successful. This is + similar to press the "Delete Branch" Button (TM) in the web interface + after merging. + Actions: \--continue |