diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 7672e99..9bb6f6f 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -38,6 +38,7 @@ F565265A0E03E71B00F03B52 /* commit.html in Resources */ = {isa = PBXBuildFile; fileRef = F56526590E03E71B00F03B52 /* commit.html */; }; F56CC7290E65E0AD004307B4 /* PBGitGraphLine.m in Sources */ = {isa = PBXBuildFile; fileRef = F56CC7280E65E0AD004307B4 /* PBGitGraphLine.m */; }; F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F56CC7310E65E0E5004307B4 /* PBGraphCellInfo.m */; }; + F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F57240BA0E9678EA00D8EE66 /* deleted_file.png */; }; F57ABE0B0E0442DD00A088B8 /* commit.js in Resources */ = {isa = PBXBuildFile; fileRef = F57ABDDE0E0441DE00A088B8 /* commit.js */; }; F57ABE2B0E04435100A088B8 /* prototype.js in Resources */ = {isa = PBXBuildFile; fileRef = F57ABE180E04431D00A088B8 /* prototype.js */; }; F57CC3910E05DDF2000472E2 /* PBEasyPipe.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */; }; @@ -142,6 +143,7 @@ F56CC7280E65E0AD004307B4 /* PBGitGraphLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitGraphLine.m; sourceTree = ""; }; F56CC7300E65E0E5004307B4 /* PBGraphCellInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGraphCellInfo.h; sourceTree = ""; }; F56CC7310E65E0E5004307B4 /* PBGraphCellInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGraphCellInfo.m; sourceTree = ""; }; + F57240BA0E9678EA00D8EE66 /* deleted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = deleted_file.png; path = Images/deleted_file.png; sourceTree = ""; }; F57ABDDE0E0441DE00A088B8 /* commit.js */ = {isa = PBXFileReference; explicitFileType = sourcecode.javascript; fileEncoding = 4; name = commit.js; path = html/commit.js; sourceTree = ""; }; F57ABE180E04431D00A088B8 /* prototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = prototype.js; path = html/prototype.js; sourceTree = ""; }; F57CC38F0E05DDF2000472E2 /* PBEasyPipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBEasyPipe.h; sourceTree = ""; }; @@ -262,6 +264,7 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + F57240BA0E9678EA00D8EE66 /* deleted_file.png */, F5EC2DAC0E8C235C000FA381 /* spinner.gif */, F5E92A1A0E88550E00056E75 /* empty_file.png */, 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */, @@ -518,6 +521,7 @@ F5E9281D0E8840CF00056E75 /* diff.html in Resources */, F5E92A230E88569500056E75 /* new_file.png in Resources */, F5EC2DAD0E8C235C000FA381 /* spinner.gif in Resources */, + F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Images/deleted_file.png b/Images/deleted_file.png new file mode 100644 index 0000000..0f924ad Binary files /dev/null and b/Images/deleted_file.png differ diff --git a/PBChangedFile.m b/PBChangedFile.m index ebc2e46..518ca64 100644 --- a/PBChangedFile.m +++ b/PBChangedFile.m @@ -39,6 +39,9 @@ case NEW: filename = @"new_file"; break; + case DELETED: + filename = @"deleted_file"; + break; default: filename = @"empty_file"; break; @@ -49,11 +52,16 @@ - (void) stageChanges { - [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"add", path, nil]]; + if (status == DELETED) + [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"rm", path, nil]]; + else + [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"add", path, nil]]; + self.cached = YES; } - (void) unstageChanges -{ [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"reset", @"--", path, nil]]; +{ + [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"reset", @"--", path, nil]]; self.cached = NO; } diff --git a/PBGitCommitController.m b/PBGitCommitController.m index c92b948..594e595 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -123,8 +123,11 @@ even = 0; PBChangedFile *file = [[PBChangedFile alloc] initWithPath:line andRepository:repository]; + if ([[fileStatus objectAtIndex:4] isEqualToString:@"D"]) + file.status = DELETED; + else + file.status = MODIFIED; - file.status = MODIFIED; file.cached = NO; // FIXME: If you are in a merge and have conflicts, a file is displayed twice, with different @@ -157,6 +160,9 @@ even = 0; PBChangedFile *file = [[PBChangedFile alloc] initWithPath:line andRepository:repository]; + if ([[fileStatus objectAtIndex:4] isEqualToString:@"D"]) + file.status = DELETED; + else file.status = MODIFIED; file.cached = YES;