Repository navigation
Commit e17d9e0
commit: lock index before reading
Take the index lock before reading the index, in one place, instead
of separately in each `if` branch.
`commit` now respects the `core.indexLockTimeout` config.
History suggests no particular reason for reading before locking:
- f5bbc32 (Port git commit to C., 2007-11-08): lock before reading
- 2888605 (builtin-commit: fix partial-commit support, 2007-11-18):
seems to accidentally move reading to before locking
Signed-off-by: Jun Wu <quark@meta.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 7eac4af commit e17d9e0
2 files changed
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
392 | 394 | | |
393 | 395 | | |
394 | 396 | | |
395 | 397 | | |
396 | 398 | | |
397 | | - | |
398 | | - | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
457 | | - | |
458 | 456 | | |
459 | 457 | | |
460 | 458 | | |
| |||
480 | 478 | | |
481 | 479 | | |
482 | 480 | | |
483 | | - | |
484 | | - | |
485 | 481 | | |
486 | 482 | | |
487 | 483 | | |
| |||
531 | 527 | | |
532 | 528 | | |
533 | 529 | | |
534 | | - | |
535 | 530 | | |
536 | 531 | | |
537 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
0 commit comments