@@ -16,7 +16,7 @@ @interface PBGitCommitController (PrivateMethods)
16
16
- (NSArray *) linesFromNotification : (NSNotification *)notification ;
17
17
- (void ) doneProcessingIndex ;
18
18
- (NSMutableDictionary *)dictionaryForLines : (NSArray *)lines ;
19
- - (void ) addFilesFromDictionary : (NSMutableDictionary *)dictionary cached : (BOOL )cached tracked : (BOOL )tracked ;
19
+ - (void ) addFilesFromDictionary : (NSMutableDictionary *)dictionary staged : (BOOL )staged tracked : (BOOL )tracked ;
20
20
@end
21
21
22
22
@implementation PBGitCommitController
@@ -32,7 +32,7 @@ - (void)awakeFromNib
32
32
[commitMessageView setTypingAttributes: [NSDictionary dictionaryWithObject: [NSFont fontWithName: @" Monaco" size: 12.0 ] forKey: NSFontAttributeName ]];
33
33
34
34
[unstagedFilesController setFilterPredicate: [NSPredicate predicateWithFormat: @" hasUnstagedChanges == 1" ]];
35
- [cachedFilesController setFilterPredicate: [NSPredicate predicateWithFormat: @" hasCachedChanges == 1" ]];
35
+ [cachedFilesController setFilterPredicate: [NSPredicate predicateWithFormat: @" hasStagedChanges == 1" ]];
36
36
37
37
[unstagedFilesController setSortDescriptors: [NSArray arrayWithObjects:
38
38
[[NSSortDescriptor alloc ] initWithKey: @" status" ascending: false ],
@@ -148,7 +148,7 @@ - (void) doneProcessingIndex
148
148
if (!--self.busy ) {
149
149
self.status = @" Ready" ;
150
150
for (PBChangedFile *file in files) {
151
- if (!file.hasCachedChanges && !file.hasUnstagedChanges ) {
151
+ if (!file.hasStagedChanges && !file.hasUnstagedChanges ) {
152
152
NSLog (@" Deleting file: %@ " , [file path ]);
153
153
[files removeObject: file];
154
154
}
@@ -169,7 +169,7 @@ - (void) readOtherFiles:(NSNotification *)notification;
169
169
continue ;
170
170
[dictionary setObject: fileStatus forKey: path];
171
171
}
172
- [self addFilesFromDictionary: dictionary cached :NO tracked: NO ];
172
+ [self addFilesFromDictionary: dictionary staged :NO tracked: NO ];
173
173
[self doneProcessingIndex ];
174
174
}
175
175
@@ -193,7 +193,7 @@ - (NSMutableDictionary *)dictionaryForLines:(NSArray *)lines
193
193
return dictionary;
194
194
}
195
195
196
- - (void ) addFilesFromDictionary : (NSMutableDictionary *)dictionary cached : (BOOL )cached tracked : (BOOL )tracked
196
+ - (void ) addFilesFromDictionary : (NSMutableDictionary *)dictionary staged : (BOOL )staged tracked : (BOOL )tracked
197
197
{
198
198
// Iterate over all existing files
199
199
for (PBChangedFile *file in files) {
@@ -204,22 +204,22 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary cached:(BOOL)c
204
204
NSString *mode = [[fileStatus objectAtIndex: 0 ] substringFromIndex: 1 ];
205
205
NSString *sha = [fileStatus objectAtIndex: 2 ];
206
206
207
- if (cached ) {
208
- file.hasCachedChanges = YES ;
207
+ if (staged ) {
208
+ file.hasStagedChanges = YES ;
209
209
file.commitBlobSHA = sha;
210
210
file.commitBlobMode = mode;
211
211
} else
212
212
file.hasUnstagedChanges = YES ;
213
213
} else {
214
214
// Untracked file, set status to NEW, only unstaged changes
215
- file.hasCachedChanges = NO ;
215
+ file.hasStagedChanges = NO ;
216
216
file.hasUnstagedChanges = YES ;
217
217
file.status = NEW;
218
218
}
219
219
[dictionary removeObjectForKey: file.path];
220
220
} else { // Object not found, let's remove it from the changes
221
- if (cached )
222
- file.hasCachedChanges = NO ;
221
+ if (staged )
222
+ file.hasStagedChanges = NO ;
223
223
else if (tracked && file.status != NEW) // Only remove it if it's not an untracked file. We handle that with the other thing
224
224
file.hasUnstagedChanges = NO ;
225
225
else if (!tracked && file.status == NEW)
@@ -239,13 +239,13 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary cached:(BOOL)c
239
239
else
240
240
file.status = MODIFIED;
241
241
242
- if (cached ) {
242
+ if (staged ) {
243
243
file.commitBlobSHA = [[fileStatus objectAtIndex: 0 ] substringFromIndex: 1 ];
244
244
file.commitBlobMode = [fileStatus objectAtIndex: 2 ];
245
245
}
246
246
247
- file.hasCachedChanges = cached ;
248
- file.hasUnstagedChanges = !cached ;
247
+ file.hasStagedChanges = staged ;
248
+ file.hasUnstagedChanges = !staged ;
249
249
250
250
[files addObject: file];
251
251
}
@@ -255,15 +255,15 @@ - (void) readUnstagedFiles:(NSNotification *)notification
255
255
{
256
256
NSArray *lines = [self linesFromNotification: notification];
257
257
NSMutableDictionary *dic = [self dictionaryForLines: lines];
258
- [self addFilesFromDictionary: dic cached :NO tracked: YES ];
258
+ [self addFilesFromDictionary: dic staged :NO tracked: YES ];
259
259
[self doneProcessingIndex ];
260
260
}
261
261
262
262
- (void ) readCachedFiles : (NSNotification *)notification
263
263
{
264
264
NSArray *lines = [self linesFromNotification: notification];
265
265
NSMutableDictionary *dic = [self dictionaryForLines: lines];
266
- [self addFilesFromDictionary: dic cached :YES tracked: YES ];
266
+ [self addFilesFromDictionary: dic staged :YES tracked: YES ];
267
267
[self doneProcessingIndex ];
268
268
}
269
269
0 commit comments