Fix searching for full SHA-256 commit hashes in Git graph (#63371)
# Objective
Search in the Git graph does not support full commit hashes in SHA-256
formatted repos, while SHA-1 formatted repos work fine.
## Solution
Use existing constants in the `git` crate instead of hardcoded values
when checking for a commit hash query.
## Testing
Added a regression test for valid SHA-1 and SHA-256 commit hash lengths,
plus rejection of hashes longer than the max length.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
<details>
<summary>Click to view showcase</summary>
The screenshots below show the commit that is being searched for open in
the Git graph.
Before:
<img width="1153" height="536" alt="before"
src="https://github.com/user-attachments/assets/e47c4523-a046-4c47-ac75-cd00845b968f"
/>
After:
<img width="1153" height="536" alt="after"
src="https://github.com/user-attachments/assets/72eeaa16-d0ec-48cb-8ca2-c2bb26f02a10"
/>
</details>
---
Release Notes:
- Fixed searching for full SHA-256 commit hashes in the Git graph.
1662f5f3f6Albert Bogusz committed on 8/29/2026, 12:11:25 PM· committed by GitHubparente3adf43