tj.git-extras/tests
Vijay Misal 8cd8741a3f
feat(mr): support Forgejo/Codeberg pull request URLs
Codeberg and other Forgejo instances expose pull requests under
refs/pull/<id>/head instead of GitLab's refs/merge-requests/<id>/head,
so passing a Codeberg pull request URL to git mr fetched the wrong
ref. Recognize the /pulls/<id> URL shape and switch to the matching
ref for that case, leaving the GitLab URL and bare numeric id
behavior unchanged.

Closes #1213
2026-08-19 18:14:30 +05:30
..
bin Mostly finish pytest to Bats conversion (#1200) 2025-03-26 11:19:30 +08:00
git-abort.bats Mostly finish pytest to Bats conversion (#1200) 2025-03-26 11:19:30 +08:00
git-alias.bats Mostly finish pytest to Bats conversion (#1200) 2025-03-26 11:19:30 +08:00
git-archive-file.bats port python tests to bats (#1264) 2026-08-12 15:43:59 +08:00
git-authors.bats Mostly finish pytest to Bats conversion (#1200) 2025-03-26 11:19:30 +08:00
git-browse-ci.bats port python tests to bats (#1264) 2026-08-12 15:43:59 +08:00
git-browse.bats port python tests to bats (#1264) 2026-08-12 15:43:59 +08:00
git-continue.bats Mostly finish pytest to Bats conversion (#1200) 2025-03-26 11:19:30 +08:00
git-mr.bats feat(mr): support Forgejo/Codeberg pull request URLs 2026-08-19 18:14:30 +05:30
git-scp.bats feat(scp): add verbose, interactive, and dry-run flags (#1261) 2026-07-14 19:43:00 +08:00
is-git-repo.bats fix(is-git-repo): recognize bare repositories (#1266) 2026-08-17 14:15:48 +08:00
README.md port python tests to bats (#1264) 2026-08-12 15:43:59 +08:00
test_util.sh port python tests to bats (#1264) 2026-08-12 15:43:59 +08:00

Testing

Tests are written in Bats so coverage can be calculated for shell commands.

Bats Testing

We require a somewhat recent version of Bats. Version v1.8.1 is tested in CI. Once it is installed, the tests can be executed like so:

bats ./tests

We highly recommend adding Bats tests for new features and fixes.

Code Coverage

Coverage can be calculated with bashcov like so:

bashcov -- bats ./tests

By default, the report will be generated in ./coverage/index.html.