Use SHORT_SHA_LENGTH for all shortened commit SHAs (#58741)

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 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

Fixes hardcoded SHA lengths not using the `SHORT_SHA_LENGTH` constant.

Release Notes:

- Reduced short commit SHAs in blame and commit tooltips from 8 to 7 -
consistent with the graph and history views.
This commit is contained in:
Albert Bogusz authored and GitHub committed 2026-06-08 06:38:39 +00:00
1 parent 3f5705b985
commit f99fe5d8c2
3 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -238,7 +238,7 @@ impl Render for CommitTooltip {
let short_commit_id = self
.commit
.sha
.get(0..8)
.get(0..git::SHORT_SHA_LENGTH)
.map(|sha| sha.to_string().into())
.unwrap_or_else(|| self.commit.sha.clone());
let full_sha = self.commit.sha.to_string();