Describe the bug
gh repo garden panics on a repository whose full name is short.
computeSeed in pkg/cmd/repo/garden/garden.go concatenates the decimal code point of each rune of the repository name and slices the first ten characters unconditionally. A name such as a/b yields six digits, so the slice panics before any API call. Two other unchecked slices in the same file, commit.Sha[0:6] and the three sha[i:j] reads in shaToColorFunc, assume a sha length the commits API does not guarantee.
Affected version
Built from trunk at 0d121e8 (2026-09-05); the code is unchanged in the current release.
Steps to reproduce the behavior
- Run
gh repo garden a/b on a terminal.
- See the panic.
Expected vs actual behavior
Expected: the garden renders, or a normal error message. Actual:
panic: runtime error: slice bounds out of range [:10] with length 6
Logs
Same as above; the panic is the whole output.
A fix that takes the digits that exist, bounds the sha slices, and drops the panic calls is ready; happy to open the PR if this is labelled help wanted.
Describe the bug
gh repo gardenpanics on a repository whose full name is short.computeSeedinpkg/cmd/repo/garden/garden.goconcatenates the decimal code point of each rune of the repository name and slices the first ten characters unconditionally. A name such asa/byields six digits, so the slice panics before any API call. Two other unchecked slices in the same file,commit.Sha[0:6]and the threesha[i:j]reads inshaToColorFunc, assume a sha length the commits API does not guarantee.Affected version
Built from trunk at 0d121e8 (2026-09-05); the code is unchanged in the current release.
Steps to reproduce the behavior
gh repo garden a/bon a terminal.Expected vs actual behavior
Expected: the garden renders, or a normal error message. Actual:
Logs
Same as above; the panic is the whole output.
A fix that takes the digits that exist, bounds the sha slices, and drops the
paniccalls is ready; happy to open the PR if this is labelled help wanted.