From f9f6809c40fef047687fc73713c85d3d26d3d845 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Fri, 28 Aug 2009 00:19:27 +0200 Subject: [PATCH] Also set blobMode / blobSha for unstaged changes. It shouldn't matter if a file has staged / unstaged changes, as long as the file is tracked, the SHA and blob should be recorded. This had really annoying complications because PBChangedFile used this information to decide whether or not to delete a file from the index when unstaging in PBGitIndexController --- PBGitCommitController.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 8342fce..320a307 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -244,12 +244,12 @@ if (tracked) { NSString *mode = [[fileStatus objectAtIndex:0] substringFromIndex:1]; NSString *sha = [fileStatus objectAtIndex:2]; + file.commitBlobSHA = sha; + file.commitBlobMode = mode; - if (staged) { + if (staged) file.hasStagedChanges = YES; - file.commitBlobSHA = sha; - file.commitBlobMode = mode; - } else + else file.hasUnstagedChanges = YES; } else { // Untracked file, set status to NEW, only unstaged changes @@ -284,7 +284,7 @@ else file.status = MODIFIED; - if (staged) { + if (tracked) { file.commitBlobMode = [[fileStatus objectAtIndex:0] substringFromIndex:1]; file.commitBlobSHA = [fileStatus objectAtIndex:2]; }