|
33 | 33 | #import "GitXCommitCopier.h"
|
34 | 34 | #import "NSSplitView+GitX.h"
|
35 | 35 | #import "PBRefMenuItem.h"
|
| 36 | +#import "PBGitStash.h" |
36 | 37 |
|
37 | 38 | #define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex"
|
38 | 39 | #define kHistoryDetailViewIndex 0
|
@@ -826,6 +827,55 @@ - (IBAction)diffWithHEAD:(id)sender
|
826 | 827 | [PBDiffWindowController showDiff:diff];
|
827 | 828 | }
|
828 | 829 |
|
| 830 | +- (IBAction)stashPop:(id)sender |
| 831 | +{ |
| 832 | + id <PBGitRefish> refish = [self refishForSender:sender refishTypes:@[kGitXStashType]]; |
| 833 | + PBGitStash *stash = [self.repository stashForRef:refish]; |
| 834 | + NSError *error = nil; |
| 835 | + BOOL success = [self.repository stashPop:stash error:&error]; |
| 836 | + |
| 837 | + if (!success) { |
| 838 | + [self.windowController showErrorSheet:error]; |
| 839 | + } else { |
| 840 | + [self.windowController showCommitView:sender]; |
| 841 | + } |
| 842 | +} |
| 843 | + |
| 844 | +- (IBAction)stashApply:(id)sender |
| 845 | +{ |
| 846 | + id <PBGitRefish> refish = [self refishForSender:sender refishTypes:@[kGitXStashType]]; |
| 847 | + PBGitStash *stash = [self.repository stashForRef:refish]; |
| 848 | + NSError *error = nil; |
| 849 | + BOOL success = [self.repository stashApply:stash error:&error]; |
| 850 | + |
| 851 | + if (!success) { |
| 852 | + [self.windowController showErrorSheet:error]; |
| 853 | + } else { |
| 854 | + [self.windowController showCommitView:sender]; |
| 855 | + } |
| 856 | +} |
| 857 | + |
| 858 | +- (IBAction)stashDrop:(id)sender |
| 859 | +{ |
| 860 | + id <PBGitRefish> refish = [self refishForSender:sender refishTypes:@[kGitXStashType]]; |
| 861 | + PBGitStash *stash = [self.repository stashForRef:refish]; |
| 862 | + NSError *error = nil; |
| 863 | + BOOL success = [self.repository stashDrop:stash error:&error]; |
| 864 | + |
| 865 | + if (!success) { |
| 866 | + [self.windowController showErrorSheet:error]; |
| 867 | + } else { |
| 868 | + [self.windowController showHistoryView:sender]; |
| 869 | + } |
| 870 | +} |
| 871 | + |
| 872 | +- (IBAction)stashViewDiff:(id)sender |
| 873 | +{ |
| 874 | + id <PBGitRefish> refish = [self refishForSender:sender refishTypes:@[kGitXStashType]]; |
| 875 | + PBGitStash *stash = [self.repository stashForRef:refish]; |
| 876 | + [PBDiffWindowController showDiffWindowWithFiles:nil fromCommit:stash.ancestorCommit diffCommit:stash.commit]; |
| 877 | +} |
| 878 | + |
829 | 879 | #pragma mark -
|
830 | 880 | #pragma mark Quick Look
|
831 | 881 |
|
|
0 commit comments