Repository navigation
Commit f95c90e
committed
Fix index.lock contention caused by git update-index on every FSEvents notification
The commit view triggered git update-index --refresh on every file-system
event via the FSEvents -> PBGitRepositoryEventNotification -> refresh chain.
This held .git/index.lock for the duration of each run, causing concurrent
git operations (git add, git commit, git stash, etc.) from terminals or
editors to fail with "Unable to create index.lock: File exists".
- Remove git update-index --refresh from the PBGitIndex refresh path;
the remaining reads (diff-index, diff-files, ls-files) are read-only
and never acquire the index lock
- Add -refreshStatCache, which runs update-index --refresh as a separate
fire-and-forget call followed by a refresh, to clear phantom stat-dirty
entries (files that appear modified due to mtime mismatch but have
unchanged content)
- Call refreshStatCache on NSApplicationDidBecomeActiveNotification so
the stat cache is reconciled when the user switches back to GitX,
rather than on every file-system event
Fixes gitx#1641 parent f8d5703 commit f95c90e
3 files changed
Lines changed: 26 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| |||
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 206 | | |
222 | 207 | | |
223 | 208 | | |
| |||
292 | 277 | | |
293 | 278 | | |
294 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| |||
0 commit comments