Skip to content

Commit 8ccc5e3

Browse files
committed
small cleanup in PBGitIndex.m
1 parent bd5ea89 commit 8ccc5e3

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Classes/git/PBGitIndex.m

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ - (BOOL)performStageOrUnstage:(BOOL)stage withFiles:(NSArray *)files
389389
if (loopTo > filesCount)
390390
loopTo = filesCount;
391391
int loopCount = 0;
392-
int i = 0;
393392

394393
// Staging
395394
while (loopCount < filesCount) {
@@ -399,7 +398,7 @@ - (BOOL)performStageOrUnstage:(BOOL)stage withFiles:(NSArray *)files
399398
// "git add -- <files>
400399
NSMutableString *input = [NSMutableString string];
401400

402-
for (i = loopFrom; i < loopTo; i++) {
401+
for (int i = loopFrom; i < loopTo; i++) {
403402
loopCount++;
404403

405404
PBChangedFile *file = [files objectAtIndex:i];
@@ -418,7 +417,6 @@ - (BOOL)performStageOrUnstage:(BOOL)stage withFiles:(NSArray *)files
418417
}
419418
}
420419

421-
422420
int ret = 1;
423421
if (stage) {
424422
[self.repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"--add", @"--remove", @"-z", @"--stdin", nil]
@@ -435,16 +433,10 @@ - (BOOL)performStageOrUnstage:(BOOL)stage withFiles:(NSArray *)files
435433
return NO;
436434
}
437435

438-
for (i = loopFrom; i < loopTo; i++) {
436+
for (int i = loopFrom; i < loopTo; i++) {
439437
PBChangedFile *file = [files objectAtIndex:i];
440-
441-
if (stage) {
442-
file.hasUnstagedChanges = NO;
443-
file.hasStagedChanges = YES;
444-
} else {
445-
file.hasUnstagedChanges = YES;
446-
file.hasStagedChanges = NO;
447-
}
438+
file.hasStagedChanges = stage;
439+
file.hasUnstagedChanges = !stage;
448440
}
449441

450442
// Prepare next iteration

0 commit comments

Comments
 (0)