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

sds / overcommit / 41181116504
92%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 31 Oct 2026 07:35AM UTC
Jobs 8
Files 223
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

31 Oct 2026 07:34AM UTC coverage: 92.069% (+0.002%) from 92.067%
41181116504

push

github

web-flow
Exclude files deleted from the working tree from all_files (#905)

Refs #699: this fixes the `overcommit --run` case narrowed down in
https://github.com/sds/overcommit/issues/699#issuecomment-974406367 and
https://github.com/sds/overcommit/issues/699#issuecomment-974433262. The
renamed-file behaviour in the original report (during a normal commit)
is not changed here.

`GitRepo.all_files` returns everything `git ls-files` lists. That
includes a tracked file that has been deleted from the working tree when
the deletion is not staged yet. `overcommit --run` uses `all_files` as
its list of modified files, so every hook that reads its
`applicable_files` then fails on that path. With `JsonSyntax` enabled:

```
$ rm a.json      # tracked, deletion not staged
$ overcommit --run
Running pre-commit hooks
Validate JSON syntax.....................................[JsonSyntax] FAILED
Hook raised unexpected error
No such file or directory @ rb_sysopen - .../a.json
```

`all_files` now drops the paths `git ls-files --deleted` reports. This
uses Git's own view rather than `File.exist?`, so a tracked broken
symlink is still listed (the `BrokenSymlinks` hook needs it).
`included_files` (used by the pre-push `Minitest` hook) goes through
`all_files` too, so it no longer passes a deleted file either.

### Tests

A new context in `spec/overcommit/git_repo_spec.rb` deletes a committed
file without staging the deletion and checks that `all_files` no longer
includes it but still includes the other files.

Run on macOS with Ruby 4.0.7 and Git 2.54.0:

- `bundle exec rspec spec/overcommit/git_repo_spec.rb -e '.all_files'`:
`4 examples, 1 failure` with `lib/overcommit/git_repo.rb` from main (the
new "is expected not to include .../tracked" example), `4 examples, 0
failures` with the change.
- Manual check in a scratch repository with only `JsonSyntax` enabled, a
committed `a.json` deleted from the working tree, then `overcommit
--run`: main fails with `No such file or directory... (continued)

2 of 2 new or added lines in 1 file covered. (100.0%)

3320 of 3606 relevant lines covered (92.07%)

3274.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 ruby3.3-ubuntu - 41181116504.1 31 Oct 2026 07:35AM UTC 446
92.03
GitHub Action Run
2 ruby3.0-ubuntu - 41181116504.2 31 Oct 2026 07:35AM UTC 446
92.0
GitHub Action Run
3 ruby4.0-ubuntu - 41181116504.3 31 Oct 2026 07:35AM UTC 446
92.04
GitHub Action Run
4 ruby3.4-ubuntu - 41181116504.4 31 Oct 2026 07:35AM UTC 446
92.04
GitHub Action Run
5 ruby3.2-ubuntu - 41181116504.5 31 Oct 2026 07:35AM UTC 446
91.98
GitHub Action Run
6 ruby2.6-ubuntu - 41181116504.6 31 Oct 2026 07:35AM UTC 446
92.0
GitHub Action Run
7 ruby3.1-ubuntu - 41181116504.7 31 Oct 2026 07:35AM UTC 446
91.98
GitHub Action Run
8 ruby2.7-ubuntu - 41181116504.8 31 Oct 2026 07:35AM UTC 446
92.0
GitHub Action Run
Source Files on build 41181116504
  • Tree
  • List 223
  • Changed 222
  • Source Changed 1
  • Coverage Changed 222
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41181116504
  • c9f6b35e on github
  • Prev Build on main (#41180088937)
  • Next Build on main (#41181226270)
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