• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sgerrand / git_hoox / 39053056729
98%

Build:
DEFAULT BRANCH: main
Ran 17 Oct 2026 05:17PM UTC
Jobs 1
Files 28
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Oct 2026 05:16PM UTC coverage: 97.892% (-0.3%) from 98.142%
39053056729

push

github

web-flow
fix: fail closed on git errors, keep the escape hatches (#29)

* fix(git): fail closed when git cannot list files

push_files/1 and changed_in_worktree/1 turned any git error into an
empty list. For pre-push that meant an unresolvable range (remote sha
not present locally) produced no files, every hook was skipped, and the
push went through unchecked.

Both now return the git error. The runner reports it as a :git failure
and mix git_hoox.run prints it, rather than routing it through the
config error formatter.

* fix(git): scan the tip when the pushed remote sha is unknown

The remote sha on pre-push stdin comes from the remote's advertised
refs, not from the local object store, so it is routinely an object
we do not hold: a branch that moved upstream since the last fetch, a
shallow or partial clone, or a push to an unrelated fork all hand us
one. Since d956d05 the unresolvable `git diff remote..local` aborts
the stage and hides git's own non-fast-forward error behind a
`git failed (exit 128)` message.

Probe with `git cat-file -e` and fall back to the new-ref listing
when the object is absent.

* refactor(runner): tag git errors where they are produced

`Runner.run/3` discriminated git failures from config failures by
matching `{integer, term}` on the `with` result. That holds only
because no `Config.Error.t()` variant happens to start with an
integer, and the clause sits above the generic config clause, so the
day one does it will print `git failed (exit 42) while resolving
files`.

Rename the per-stage dispatch to `resolve_files/3` and wrap it in
`files_for_stage/3`, which tags anything that is not
`{:missing_args, _}` as `{:error, {:git, reason}}`. The outcome shape
the mix task prints is unchanged.

* fix(runner): resolve files only when a hook will run

Fail-closed file resolution ran before the skip filter, so a git
failure aborted the stage even when nothing was going to run.
`GIT_HOOX=0`, a fully-excluding `GIT_HOOX_EXCLUDE` and stages with ... (continued)

40 of 45 new or added lines in 5 files covered. (88.89%)

650 of 664 relevant lines covered (97.89%)

28.93 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
96.97
0.2% lib/git_hoox/runner.ex
1
96.0
-1.96% lib/git_hoox/reporter.ex
1
90.0
-2.31% lib/mix/tasks/git_hoox.run.ex
Jobs
ID Job ID Ran Files Coverage
1 39053056729.1 17 Oct 2026 05:17PM UTC 28
97.89
GitHub Action Run
Source Files on build 39053056729
  • Tree
  • List 28
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39053056729
  • 1e0da545 on github
  • Prev Build on main (#39026129350)
  • Next Build on main (#40288468038)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc