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
This commit is contained in:
Pieter de Bie
2009-08-28 00:19:27 +02:00
parent 9320ef71a8
commit f9f6809c40
+5 -5
View File
@@ -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];
}