File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,13 @@ - (void) awakeFromNib
24
24
- (void ) showStash : (PBGitStash*)stash
25
25
{
26
26
NSString *stashRef = [NSString stringWithFormat: @" refs/%@ " , [stash name ]];
27
- NSString *stashSha = [repository shaForRef: [PBGitRef refFromString: stashRef]];
28
- PBGitCommit *commit = [PBGitCommit commitWithRepository: repository andSha: stashSha];
27
+ NSString *stashSHA = [repository shaForRef: [PBGitRef refFromString: stashRef]];
28
+ PBGitCommit *commit = [repository commitForSHA: stashSHA];
29
+ NSString *indexSHA = [commit.parents objectAtIndex: 1 ];
30
+ PBGitCommit *indexCommit = [repository commitForSHA: indexSHA];
29
31
30
32
[unstagedController changeContentTo: commit];
33
+ [stagedController changeContentTo: indexCommit];
31
34
}
32
35
33
36
- (CGFloat)splitView : (NSSplitView *)splitView constrainMinCoordinate : (CGFloat)proposedMin ofSubviewAt : (NSInteger )dividerIndex
Original file line number Diff line number Diff line change 32
32
- (NSString *) refsForCurrentCommit ;
33
33
// Look up a PBGitRef based on its SHA.
34
34
- (PBGitRef*) refFromString : (NSString *)refString ;
35
+ // Choose which parents should be used for the diff
36
+ - (NSArray *) chooseDiffParents : (NSArray *)parents ;
35
37
// Context menu items to be displayed for a file.
36
38
- (NSArray *) menuItemsForPath : (NSString *)path ;
37
39
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ - (void)commitDetailsLoaded:(NSNotification *)notification
104
104
}
105
105
}
106
106
107
- NSString *parents = [parentsArray componentsJoinedByString: @" " ];
107
+ NSString *parents = [[ self chooseDiffParents: parentsArray] componentsJoinedByString: @" " ];
108
108
109
109
// File Stats
110
110
NSMutableDictionary *stats = [self parseStats: details];
@@ -136,6 +136,11 @@ - (NSString*) refsForCurrentCommit
136
136
return @" " ;
137
137
}
138
138
139
+ - (NSArray *) chooseDiffParents : (NSArray *)parents
140
+ {
141
+ return parents;
142
+ }
143
+
139
144
- (NSMutableDictionary *)parseStats : (NSString *)txt
140
145
{
141
146
NSArray *lines = [txt componentsSeparatedByString: @" \n " ];
Original file line number Diff line number Diff line change @@ -19,4 +19,9 @@ - (NSArray*) menuItemsForPath:(NSString*)path
19
19
return [[stashController superController ] menuItemsForPaths: [NSArray arrayWithObject: path]];
20
20
}
21
21
22
+ - (NSArray *) chooseDiffParents : (NSArray *)parents
23
+ {
24
+ return [NSArray arrayWithObject: [parents objectAtIndex: 0 ]];
25
+ }
26
+
22
27
@end
You can’t perform that action at this time.
0 commit comments