diff --git a/PBGitCommitController.h b/PBGitCommitController.h index 575b17e..31f3419 100644 --- a/PBGitCommitController.h +++ b/PBGitCommitController.h @@ -41,6 +41,8 @@ - (void) readUnstagedFiles:(NSNotification *)notification; - (void) stageHunk: (NSString *)hunk reverse:(BOOL)reverse; +- (NSString *)parentTree; + - (IBAction) refresh:(id) sender; - (IBAction) commit:(id) sender; @end diff --git a/PBGitIndexController.m b/PBGitIndexController.m index e56e553..45ca2a7 100644 --- a/PBGitIndexController.m +++ b/PBGitIndexController.m @@ -85,7 +85,7 @@ if (file.status == NEW) return [commitController.repository outputForArguments:[NSArray arrayWithObjects:@"show", indexPath, nil]]; - return [commitController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff", file.commitBlobSHA, indexPath, nil]]; + return [commitController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff-index", @"-p", @"--cached", [commitController parentTree], @"--", file.path, nil]]; } - (NSString *)unstagedChangesForFile:(PBChangedFile *)file