Commit 83ae209
committed
checkout branch: prime cache-tree fully
When switching to another branch, the earlier code relied on incremental
invalidation of cache-tree entries to degrade it. While it is not wrong
per-se, we know that the resulting index must fully match the branch we
are switching to unless the -m (merge) option is used.
We should simply fully re-prime the cache-tree using the new tree object
in such a case. And for safety, invalidate the cache-tree as a whole in
other cases.
Signed-off-by: Junio C Hamano <[email protected]>1 parent 456156d commit 83ae209
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| 376 | + | |
375 | 377 | | |
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
| 381 | + | |
379 | 382 | | |
380 | 383 | | |
381 | 384 | | |
| |||
411 | 414 | | |
412 | 415 | | |
413 | 416 | | |
414 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
415 | 420 | | |
416 | 421 | | |
417 | 422 | | |
| |||
455 | 460 | | |
456 | 461 | | |
457 | 462 | | |
| 463 | + | |
| 464 | + | |
458 | 465 | | |
459 | 466 | | |
460 | 467 | | |
| |||
0 commit comments