git_ui: Fix amend not working for detached HEAD (#29017)

Closes #28736

Release Notes:

- Fixed git amend not working for detached HEAD.
6e0732a9d7Smit Barmase committed on 4/18/2025, 12:45:54 AM· committed by GitHubparentf8d097a
2 files changedLine totals unavailable