Skip to content

Commit f9f6809

Browse files
committed
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
1 parent 9320ef7 commit f9f6809

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

PBGitCommitController.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)s
244244
if (tracked) {
245245
NSString *mode = [[fileStatus objectAtIndex:0] substringFromIndex:1];
246246
NSString *sha = [fileStatus objectAtIndex:2];
247+
file.commitBlobSHA = sha;
248+
file.commitBlobMode = mode;
247249

248-
if (staged) {
250+
if (staged)
249251
file.hasStagedChanges = YES;
250-
file.commitBlobSHA = sha;
251-
file.commitBlobMode = mode;
252-
} else
252+
else
253253
file.hasUnstagedChanges = YES;
254254
} else {
255255
// Untracked file, set status to NEW, only unstaged changes
@@ -284,7 +284,7 @@ - (void) addFilesFromDictionary:(NSMutableDictionary *)dictionary staged:(BOOL)s
284284
else
285285
file.status = MODIFIED;
286286

287-
if (staged) {
287+
if (tracked) {
288288
file.commitBlobMode = [[fileStatus objectAtIndex:0] substringFromIndex:1];
289289
file.commitBlobSHA = [fileStatus objectAtIndex:2];
290290
}

0 commit comments

Comments
 (0)