git: Prefer main over master when detecting default branch (#57398)

Many projects are switching to main as the default branch name. Prefer
it over master, in case both are present.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
950fd46d5cHenrique Ferreiro committed on 6/1/2026, 3:21:21 AM· committed by GitHubparent6d605b3
1 file changedLine totals unavailable