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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #56602.
Creating a branch from the branch picker normalizes the typed name with
`replace(' ', "-")`, so leading or trailing spaces became leading or
trailing hyphens (e.g. ` fix-leak ` -> `-fix-leak-`). git rejects such
names, so branch creation failed.
Trimming the query before replacing spaces yields a valid name.
Release Notes:
- git_ui: Fixed branch creation failing when a branch name had leading
or trailing whitespace
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>1 file changedLine totals unavailable