File tree Expand file tree Collapse file tree 2 files changed +26
-28
lines changed Expand file tree Collapse file tree 2 files changed +26
-28
lines changed Original file line number Diff line number Diff line change @@ -876,6 +876,32 @@ - (IBAction)stashViewDiff:(id)sender
876
876
[PBDiffWindowController showDiffWindowWithFiles: nil fromCommit: stash.ancestorCommit diffCommit: stash.commit];
877
877
}
878
878
879
+ - (IBAction )showTagInfoSheet : (id )sender
880
+ {
881
+ id <PBGitRefish> refish = [self refishForSender: sender refishTypes: @[kGitXTagType ]];
882
+ if (!refish)
883
+ return ;
884
+
885
+ PBGitRef *ref = (PBGitRef *)refish;
886
+
887
+ NSError *error = nil ;
888
+ NSString *tagName = [ref tagName ];
889
+ NSString *tagRef = [@" refs/tags/" stringByAppendingString: tagName];
890
+ GTObject *object = [self .repository.gtRepo lookUpObjectByRevParse: tagRef error: &error];
891
+ if (!object) {
892
+ NSLog (@" Couldn't look up ref %@ :%@ " , tagRef, [error debugDescription ]);
893
+ return ;
894
+ }
895
+ NSString *title = [NSString stringWithFormat: @" Info for tag: %@ " , tagName];
896
+ NSString *info = @" " ;
897
+ if ([object isKindOfClass: [GTTag class ]]) {
898
+ GTTag *tag = (GTTag*)object;
899
+ info = tag.message ;
900
+ }
901
+
902
+ [self .windowController showMessageSheet: title infoText: info];
903
+ }
904
+
879
905
#pragma mark -
880
906
#pragma mark Quick Look
881
907
Original file line number Diff line number Diff line change @@ -26,34 +26,6 @@ - (void)awakeFromNib
26
26
[commitList registerForDraggedTypes: [NSArray arrayWithObject: @" PBGitRef" ]];
27
27
}
28
28
29
- #pragma mark Tags
30
-
31
- - (IBAction ) showTagInfoSheet : (PBRefMenuItem *)sender
32
- {
33
- id <PBGitRefish> refish = sender.refishs .firstObject ;
34
- if ([refish refishType ] != kGitXTagType )
35
- return ;
36
-
37
- PBGitRef *ref = (PBGitRef *)refish;
38
-
39
- NSString *tagName = [ref tagName ];
40
- NSString *tagRef = [@" refs/tags/" stringByAppendingString: tagName];
41
- NSError *error = nil ;
42
- GTObject *object = [historyController.repository.gtRepo lookUpObjectByRevParse: tagRef error: &error];
43
- if (!object) {
44
- NSLog (@" Couldn't look up ref %@ :%@ " , tagRef, [error debugDescription ]);
45
- return ;
46
- }
47
- NSString * title = [NSString stringWithFormat: @" Info for tag: %@ " , tagName];
48
- NSString * info = @" " ;
49
- if ([object isKindOfClass: [GTTag class ]]) {
50
- GTTag *tag = (GTTag*)object;
51
- info = tag.message ;
52
- }
53
- [historyController.windowController showMessageSheet: title infoText: info];
54
- }
55
-
56
-
57
29
#pragma mark Contextual menus
58
30
59
31
- (NSArray <NSMenuItem *> *) menuItemsForRef : (PBGitRef *)ref
You can’t perform that action at this time.
0 commit comments