Skip to content

Commit 6f83f23

Browse files
committed
Bugfix: Rebasing the head ref
Only use the ref being rebased onto otherwise git will create a detached HEAD.
1 parent 9a9de95 commit 6f83f23

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

PBGitHistoryController.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,8 @@ - (IBAction) cherryPick:(id)sender
671671

672672
- (IBAction) rebase:(id)sender
673673
{
674-
if (selectedCommit) {
675-
PBGitRef *headRef = [[repository headRef] ref];
676-
[repository rebaseBranch:headRef onRefish:selectedCommit];
677-
}
674+
if (selectedCommit)
675+
[repository rebaseBranch:nil onRefish:selectedCommit];
678676
}
679677

680678
#pragma mark -

PBRefController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ - (void) cherryPick:(PBRefMenuItem *)sender
147147
- (void) rebaseHeadBranch:(PBRefMenuItem *)sender
148148
{
149149
id <PBGitRefish> refish = [sender refish];
150-
PBGitRef *headRef = [[historyController.repository headRef] ref];
151150

152-
[historyController.repository rebaseBranch:headRef onRefish:refish];
151+
[historyController.repository rebaseBranch:nil onRefish:refish];
153152
}
154153

155154

0 commit comments

Comments
 (0)