Commit graph

45 commits

Author SHA1 Message Date
e495aa826e
Add a failing test to show that master isn't supported
```git-check-assertions
run ./test/git-check-assertions.bats
assert_failure
assert_output --partial "fatal: Not a valid object name main"
```
2026-03-04 07:57:12 +01:00
fcea18e820
Add a real-world example to the README 2026-03-04 07:48:26 +01:00
Sven van Heugten
cb74f351f7 Merge pull request 'Restore the worktree after a failure' (#8) from restore-worktree-after-failure into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/8
2026-03-04 07:46:58 +01:00
2299ee3407
Restore the worktree after a failure
```git-check-assertions
run ./test/git-check-assertions.bats
assert_success
```
2026-03-04 07:40:23 +01:00
99bcd7460f
Add failing test to check if the worktree is restored after failure
This test currently doesn't pass:

```git-check-assertions
run ./test/git-check-assertions.bats
assert_failure
assert_output --partial "file is greater than 0 byte"
```
2026-03-04 07:38:06 +01:00
Sven van Heugten
6963d06363 Merge pull request 'Add partial change example' (#7) from add-partial-change-example into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/7
2026-03-04 07:32:41 +01:00
d8e758387c
Add partial change example
```git-check-assertions
sed -i 's/HEAD~/HEAD/' test/git-check-assertions.bats
run test/git-check-assertions.bats
assert_failure
assert_output --partial "Expected command to fail, but it succeeded."
```
2026-03-04 07:27:46 +01:00
66a30d61cf
Fix typo 2026-03-04 07:03:47 +01:00
Sven van Heugten
a330b66ad0 Merge pull request 'Add better helper functions' (#6) from better-helper-functions into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/6
2026-03-03 21:15:02 +01:00
4eadcbe437
Document the helper functions 2026-03-03 21:14:08 +01:00
d244a706f3
Remove old assert_fails 2026-03-03 20:32:22 +01:00
523df74b72
Use the new functions in the README examples 2026-03-03 20:32:14 +01:00
3036d6d37e
Introduce --partial on assert_output 2026-03-03 20:29:39 +01:00
475b0c6fa1
Verify that stderr is taken into account 2026-03-03 20:28:17 +01:00
b57d527d6e
Introduce assert_output 2026-03-03 20:26:07 +01:00
f9d6696687
Introduce assert_failure 2026-03-03 20:23:39 +01:00
1a10b24b06
Introduce assert_success 2026-03-03 20:22:34 +01:00
a1ffb1abd4
Fix incorrect number in diff 2026-03-03 07:25:23 +01:00
Sven van Heugten
e219f037a5 Merge pull request 'Add installation instructions and initial test coverage' (#5) from add-tests into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/5
2026-03-03 07:20:28 +01:00
1fb1fcc4fa
Add installation instructions 2026-03-03 07:16:29 +01:00
e9c8e3b35e
Use bats.withLibraries instead of submodules 2026-03-03 07:16:29 +01:00
f4cdb276c3
Add some initial tests 2026-03-03 07:16:29 +01:00
5dbb6aea8f
Set up shfmt 2026-03-03 07:16:29 +01:00
769d7da9b2
Use git init to immediately create the correct branch 2026-03-03 07:16:28 +01:00
f5f05c0a9e
Set up the git repository in the bats file instead 2026-03-03 07:16:28 +01:00
e48e27fb52
Add helper modules for bats
According to these instructions:
https://bats-core.readthedocs.io/en/stable/tutorial.html#quick-installation
2026-03-03 07:16:28 +01:00
653a1b67bc
Move test.bats to test/git-check-assertions.bats 2026-03-03 07:16:28 +01:00
a82e98d775
Move git-check-assertions to bin/ 2026-03-03 07:16:28 +01:00
Sven van Heugten
601a51109d Merge pull request 'Add missing runtime dependencies' (#4) from add-missing-runtime-dependencies into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/4
2026-02-22 16:28:43 +01:00
d894affa35
Switch to resholve 2026-02-22 16:21:00 +01:00
13c34cbabc
Add missing runHooks 2026-02-22 15:44:56 +01:00
51c4e949bb
Add missing runtime dependencies 2026-02-22 15:44:56 +01:00
Sven van Heugten
218f812012 Merge pull request 'Run tests when building the nix package' (#3) from run-tests-in-nix into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/3
2026-02-22 11:13:07 +01:00
c04ccf4974
Run tests when building the nix package 2026-02-22 11:12:22 +01:00
Sven van Heugten
390ea446de Merge pull request 'Add test boilerplate' (#2) from test-boilerplate into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/2
2026-02-22 07:27:15 +01:00
144ef949cf
Add test.bats 2026-02-22 07:07:26 +01:00
9fb8507056
git-check-assertions.sh -> git-check-assertions 2026-02-22 07:07:10 +01:00
Sven van Heugten
8ac30906df Merge pull request 'Package with nix' (#1) from package into main
Reviewed-on: https://codeberg.org/svenvanheugten/git-check-assertions/pulls/1
2026-02-22 06:49:16 +01:00
4fe66154c3
Add a nix package 2026-02-22 06:48:48 +01:00
e77a4ee485
Add .sh to .editorconfig 2026-02-22 06:48:48 +01:00
fa2eef0078
Remove tabwidth= in .editorconfig
tab_width: [...]. This defaults to the value of indent_size and doesn't usually need to be specified.

(https://editorconfig.org/)
2026-02-22 06:31:47 +01:00
c39e0c2fd6
Add bats to the dev shell 2026-02-22 06:12:37 +01:00
f62f51f77e
Add a flake with an empty dev shell 2026-02-21 18:33:25 +01:00
4508d3f1b3
Make it possible to alter code inside of the bash script 2026-02-21 08:06:04 +01:00
f87d6bd4c8
Initial commit 2026-02-21 08:06:04 +01:00