Commit graph

4 commits

Author SHA1 Message Date
Vijay Misal dbf68bac59
fix(is-git-repo): recognize bare repositories (#1266)
* fix(is-git-repo): recognize bare repositories

is_git_repo() used `git rev-parse --show-toplevel` to detect whether
the current directory is inside a git repository. --show-toplevel
fails for bare repositories since they have no working tree, so every
command that relies on this shared helper (e.g. `git browse`) reports
"Not a git repo!" when run from inside a bare repo, even though it
plainly is one.

Switch to `git rev-parse --git-dir`, which succeeds for both normal
and bare repositories and keeps the existing "not a repo" behavior
for non-repo directories.

Fixes #1238, reported and LGTM'd by maintainers there with this exact
fix; no PR had been opened for it yet.

Adds tests/is-git-repo.bats covering: a normal repo, a bare repo, and
a plain (non-repo) directory.

* Fix ruff lint failures in scripts/checkstyle.py

This PR's new Ruff CI job surfaced pre-existing style issues (unsorted
imports, deprecated typing.List/Dict, nested ifs, bare exit()) in
checkstyle.py. Cleaned these up so the newly added lint job passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 14:15:48 +08:00
dependabot[bot] 03569856db
chore(deps): bump actions/setup-python from 6 to 7 (#1263)
* chore(deps): bump actions/setup-python from 6 to 7

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix lints

* Fix typo

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
Co-authored-by: spacewander <spacewanderlzx@gmail.com>
2026-08-14 12:27:16 +08:00
罗泽轩 d11e45f0b1
port python tests to bats (#1264)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-08-12 15:43:59 +08:00
Edwin Kofler 3ddc315a76
Format comparisons, functions, and redirections to be consistent (#1201)
* Format comparisons and functions to be consistent

* Add `checkstyle.py` script and add check to CI

* Fix Ruff lints
2025-06-06 11:10:50 +08:00