From e0d8df63e810828ecea97ef575a1c56f9a137a6f Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Tue, 2 Dec 2008 00:40:33 +0100 Subject: [PATCH] IndexController: Don't try to be smart when diffing staged changes We previously used some cool git syntax to display changes in the index. The unfortunate side-effect of this was that the diff headers weren't correct, so the unstage button didn't work anymore. --- PBGitCommitController.h | 2 ++ PBGitIndexController.m | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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