fix(server): checkpoints no longer rehash every file when an entry is flagged

A copied checkpoint index with any manually flagged entry (assume-unchanged,
skip-worktree outside sparse checkout, or an in-cone skip-worktree) was
discarded for a stat-less read-tree HEAD, so add -A rehashed every tracked
file and large worktrees hit the 30s timeout.

Keep the copied index and re-add only the flagged entries through
update-index --index-info on the private index. They keep mode, OID and
stage, lose their flag bits, and get an empty stat cache, so add -A rehashes
only those paths. The racy index timestamp is restored afterwards.
Out-of-cone sparse entries keep skip-worktree. Invalid UTF-8 paths, flagged
gitlinks, assume-unchanged on sparse skip-worktree entries, more than 1 MiB
of flagged records, and any failure all fall back to the fresh index.

Closes #13741

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13edaac664Julius Marminge committed on 10/22/2026, 12:43:04 PMparent171106a
2 files changedLine totals unavailable