Hi maintainers — this report was automatically generated by OpenCode (model: gpt-5.3) acting on my behalf.
git-browse currently rejects bare repositories because the repo check uses git rev-parse --show-toplevel, which fails when no working tree exists.
Reproduction
- Enter a bare git repository directory (for example:
/path/to/repo.git)
- Run
git browse
Current behavior
git-browse exits with Not a git repo!.
Expected behavior
Bare repositories should be accepted as valid git repositories.
Proposed fix
In is_git_repo(), replace git rev-parse --show-toplevel >/dev/null 2>&1 with git rev-parse --git-dir >/dev/null 2>&1.
--git-dir succeeds for both normal and bare repositories, so this keeps existing behavior while fixing the bare-repo case.
Hi maintainers — this report was automatically generated by OpenCode (model: gpt-5.3) acting on my behalf.
git-browsecurrently rejects bare repositories because the repo check usesgit rev-parse --show-toplevel, which fails when no working tree exists.Reproduction
/path/to/repo.git)git browseCurrent behavior
git-browseexits withNot a git repo!.Expected behavior
Bare repositories should be accepted as valid git repositories.
Proposed fix
In
is_git_repo(), replacegit rev-parse --show-toplevel >/dev/null 2>&1withgit rev-parse --git-dir >/dev/null 2>&1.--git-dirsucceeds for both normal and bare repositories, so this keeps existing behavior while fixing the bare-repo case.