Skip to content
Browse files

Rename 'CachedChanges" to "StagedChanges" for greater consistency

  • Loading branch information...
1 parent f9ff15c commit 0d8ba8c2632e129fe7627f86d907c8b470c1bf20 @pieter committed May 28, 2009
Showing with 20 additions and 20 deletions.
  1. +2 −2 PBChangedFile.h
  2. +1 −1 PBChangedFile.m
  3. +15 −15 PBGitCommitController.m
  4. +2 −2 PBGitIndexController.m
View
4 PBChangedFile.h
@@ -17,7 +17,7 @@ typedef enum {
@interface PBChangedFile : NSObject {
NSString *path;
- BOOL hasCachedChanges;
+ BOOL hasStagedChanges;
BOOL hasUnstagedChanges;
// Index and HEAD stuff, to be used to revert changes
@@ -30,7 +30,7 @@ typedef enum {
@property (copy) NSString *path, *commitBlobSHA, *commitBlobMode;
@property (assign) PBChangedFileStatus status;
-@property (assign) BOOL hasCachedChanges, hasUnstagedChanges;
+@property (assign) BOOL hasStagedChanges, hasUnstagedChanges;
- (NSImage *)icon;
- (NSString *)indexInfo;
View
2 PBChangedFile.m
@@ -11,7 +11,7 @@
@implementation PBChangedFile
-@synthesize path, status, hasCachedChanges, hasUnstagedChanges, commitBlobSHA, commitBlobMode;
+@synthesize path, status, hasStagedChanges, hasUnstagedChanges, commitBlobSHA, commitBlobMode;
- (id) initWithPath:(NSString *)p
{
View
30 PBGitCommitController.m
@@ -16,7 +16,7 @@ @interface PBGitCommitController (PrivateMethods)
- (NSArray *) linesFromNotification:(NSNotification *)notification;
- (void) doneProcessingIndex;
- (NSMutableDictionary *)dictionaryForLines:(NSArray *)lines;
-- (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary cached:(BOOL)cached tracked:(BOOL)tracked;
+- (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)staged tracked:(BOOL)tracked;
@end
@implementation PBGitCommitController
@@ -32,7 +32,7 @@ - (void)awakeFromNib
[commitMessageView setTypingAttributes:[NSDictionary dictionaryWithObject:[NSFont fontWithName:@"Monaco" size:12.0] forKey:NSFontAttributeName]];
[unstagedFilesController setFilterPredicate:[NSPredicate predicateWithFormat:@"hasUnstagedChanges == 1"]];
- [cachedFilesController setFilterPredicate:[NSPredicate predicateWithFormat:@"hasCachedChanges == 1"]];
+ [cachedFilesController setFilterPredicate:[NSPredicate predicateWithFormat:@"hasStagedChanges == 1"]];
[unstagedFilesController setSortDescriptors:[NSArray arrayWithObjects:
[[NSSortDescriptor alloc] initWithKey:@"status" ascending:false],
@@ -148,7 +148,7 @@ - (void) doneProcessingIndex
if (!--self.busy) {
self.status = @"Ready";
for (PBChangedFile *file in files) {
- if (!file.hasCachedChanges && !file.hasUnstagedChanges) {
+ if (!file.hasStagedChanges && !file.hasUnstagedChanges) {
NSLog(@"Deleting file: %@", [file path]);
[files removeObject:file];
}
@@ -169,7 +169,7 @@ - (void) readOtherFiles:(NSNotification *)notification;
continue;
[dictionary setObject:fileStatus forKey:path];
}
- [self addFilesFromDictionary:dictionary cached:NO tracked:NO];
+ [self addFilesFromDictionary:dictionary staged:NO tracked:NO];
[self doneProcessingIndex];
}
@@ -193,7 +193,7 @@ - (NSMutableDictionary *)dictionaryForLines:(NSArray *)lines
return dictionary;
}
-- (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary cached:(BOOL)cached tracked:(BOOL)tracked
+- (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)staged tracked:(BOOL)tracked
{
// Iterate over all existing files
for (PBChangedFile *file in files) {
@@ -204,22 +204,22 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary cached:(BOOL)c
NSString *mode = [[fileStatus objectAtIndex:0] substringFromIndex:1];
NSString *sha = [fileStatus objectAtIndex:2];
- if (cached) {
- file.hasCachedChanges = YES;
+ if (staged) {
+ file.hasStagedChanges = YES;
file.commitBlobSHA = sha;
file.commitBlobMode = mode;
} else
file.hasUnstagedChanges = YES;
} else {
// Untracked file, set status to NEW, only unstaged changes
- file.hasCachedChanges = NO;
+ file.hasStagedChanges = NO;
file.hasUnstagedChanges = YES;
file.status = NEW;
}
[dictionary removeObjectForKey:file.path];
} else { // Object not found, let's remove it from the changes
- if (cached)
- file.hasCachedChanges = NO;
+ if (staged)
+ file.hasStagedChanges = NO;
else if (tracked && file.status != NEW) // Only remove it if it's not an untracked file. We handle that with the other thing
file.hasUnstagedChanges = NO;
else if (!tracked && file.status == NEW)
@@ -239,13 +239,13 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary cached:(BOOL)c
else
file.status = MODIFIED;
- if (cached) {
+ if (staged) {
file.commitBlobSHA = [[fileStatus objectAtIndex:0] substringFromIndex:1];
file.commitBlobMode = [fileStatus objectAtIndex:2];
}
- file.hasCachedChanges = cached;
- file.hasUnstagedChanges = !cached;
+ file.hasStagedChanges = staged;
+ file.hasUnstagedChanges = !staged;
[files addObject: file];
}
@@ -255,15 +255,15 @@ - (void) readUnstagedFiles:(NSNotification *)notification
{
NSArray *lines = [self linesFromNotification:notification];
NSMutableDictionary *dic = [self dictionaryForLines:lines];
- [self addFilesFromDictionary:dic cached:NO tracked:YES];
+ [self addFilesFromDictionary:dic staged:NO tracked:YES];
[self doneProcessingIndex];
}
- (void) readCachedFiles:(NSNotification *)notification
{
NSArray *lines = [self linesFromNotification:notification];
NSMutableDictionary *dic = [self dictionaryForLines:lines];
- [self addFilesFromDictionary:dic cached:YES tracked:YES];
+ [self addFilesFromDictionary:dic staged:YES tracked:YES];
[self doneProcessingIndex];
}
View
4 PBGitIndexController.m
@@ -58,7 +58,7 @@ - (void) stageFiles:(NSArray *)files
for (PBChangedFile *file in files)
{
file.hasUnstagedChanges = NO;
- file.hasCachedChanges = YES;
+ file.hasStagedChanges = YES;
}
[self resumeTrackingIndex];
}
@@ -85,7 +85,7 @@ - (void) unstageFiles:(NSArray *)files
for (PBChangedFile *file in files)
{
file.hasUnstagedChanges = YES;
- file.hasCachedChanges = NO;
+ file.hasStagedChanges = NO;
}
[self resumeTrackingIndex];
}

0 comments on commit 0d8ba8c

Please sign in to comment.
Something went wrong with that request. Please try again.