git: Optimistically stage hunks when staging a file, take 2 (#45278)

Relanding #43434 with an improved approach.

Release Notes:

- N/A

---------

Co-authored-by: Ramon <55579979+van-sprundel@users.noreply.github.com>
07db88a327Cole Miller committed on 12/19/2025, 7:08:49 PM· committed by GitHubparente61f908
3 files changedLine totals unavailable