File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -647,7 +647,7 @@ - (IBAction)merge:(id)sender
647
647
648
648
- (IBAction )rebase : (id )sender
649
649
{
650
- id <PBGitRefish> refish = [self refishForSender: sender refishTypes: @[kGitXBranchType , kGitXRemoteBranchType ]];
650
+ id <PBGitRefish> refish = [self refishForSender: sender refishTypes: @[kGitXCommitType ]];
651
651
if (!refish) return ;
652
652
653
653
NSError *error = nil ;
@@ -659,7 +659,10 @@ - (IBAction)rebase:(id)sender
659
659
660
660
- (IBAction )rebaseHeadBranch : (id )sender
661
661
{
662
- id <PBGitRefish> refish = [self refishForSender: sender refishTypes: @[kGitXBranchType , kGitXRemoteBranchType ]];
662
+ id <PBGitRefish> refish = [self refishForSender: sender refishTypes: @[kGitXCommitType ]];
663
+ if (!refish || ![refish isKindOfClass: [PBGitCommit class ]])
664
+ return ;
665
+
663
666
NSError *error = nil ;
664
667
BOOL success = [self .repository rebaseBranch: nil onRefish: refish error: &error];
665
668
if (!success) {
Original file line number Diff line number Diff line change @@ -893,8 +893,7 @@ - (BOOL) cherryPickRefish:(id <PBGitRefish>)ref error:(NSError **)error
893
893
894
894
- (BOOL ) rebaseBranch : (id <PBGitRefish>)branch onRefish : (id <PBGitRefish>)upstream error : (NSError **)error
895
895
{
896
- if (!upstream)
897
- return NO ;
896
+ NSParameterAssert (upstream != nil );
898
897
899
898
NSArray *arguments = @[@" rebase" , upstream.refishName];
900
899
You can’t perform that action at this time.
0 commit comments