Skip to content

Commit 433d63d

Browse files
committed
Default to the last stash when no stash is provided
As the "Stage > Pop stash…" has no represented object, this was raising an exception
1 parent 84324d1 commit 433d63d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Classes/Controllers/PBGitWindowController.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,12 @@ - (IBAction)stashPop:(id)sender
692692
{
693693
id <PBGitRefish> refish = [self refishForSender:sender refishTypes:@[kGitXStashType]];
694694
PBGitStash *stash = [self.repository stashForRef:refish];
695+
if (!stash) {
696+
stash = self.repository.stashes.firstObject;
697+
}
698+
695699
NSError *error = nil;
696700
BOOL success = [self.repository stashPop:stash error:&error];
697-
698701
if (!success) {
699702
[self showErrorSheet:error];
700703
}

0 commit comments

Comments
 (0)