Skip to content

Commit 30d1d07

Browse files
committed
Report coherent index snapshot counts accurately
gitx/gitx#530 gitx/gitx#428
1 parent 1572b76 commit 30d1d07

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎Classes/git/PBGitIndex.m‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ - (void)refresh
187187
// Merge the three snapshots in Git-semantic order. The staged snapshot
188188
// owns the parent-tree metadata used by whole-file unstage; the unstaged
189189
// snapshot must not replace it with the current index entry.
190+
NSUInteger stagedCount = stagedDictionary.count;
191+
NSUInteger unstagedCount = unstagedDictionary.count;
192+
NSUInteger untrackedCount = untrackedDictionary.count;
193+
190194
if (stagedDictionary) {
191195
for (PBChangedFile *file in self.files)
192196
file.hasStagedChanges = NO;
@@ -202,9 +206,9 @@ - (void)refresh
202206
if (untrackedDictionary)
203207
[self addFilesFromDictionary:untrackedDictionary staged:NO tracked:NO];
204208
NSLog(@"[GitX] Merged index refresh snapshots: %lu staged, %lu unstaged, %lu untracked",
205-
(unsigned long)stagedDictionary.count,
206-
(unsigned long)unstagedDictionary.count,
207-
(unsigned long)untrackedDictionary.count);
209+
(unsigned long)stagedCount,
210+
(unsigned long)unstagedCount,
211+
(unsigned long)untrackedCount);
208212

209213
// We need to find all files that don't have either
210214
// staged or unstaged files, and delete them

0 commit comments

Comments
 (0)