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

sds / overcommit / 745 / 5
91%
master: 91%

Build:
DEFAULT BRANCH: master
Ran 10 Apr 2015 04:17AM UTC
Files 105
Run time 25s
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

10 Apr 2015 04:00AM UTC coverage: 88.014% (+24.1%) from 63.916%
jruby-19mode

push

travis-ci

sds
Protect against lost changes when setup_environment fails

Commit c3d972d4 fixed an issue where we would not restore changes in the
event a plugin failed to load. Unfortunately, it introduced a regression
where if `setup_environment` were to raise an error for any reason we
would always call `cleanup_environment`.

This is not necessarily always safe. For example, in the case of
pre-commit, `setup_environment` might fail before it is able to create a
stash of the working tree, so calling `cleanup_environment` could result
in lost changes.

Change the ordering so that we (hopefully) get the best of both worlds:

  * Call `load_hooks` first outside of the `begin`/`ensure` block so
    that if it fails we haven't touched the repository yet, so the repo
    won't be in a bad state if a plugin can't be loaded or a signature
    is invalid

  * Call `setup_environment` outside of the `begin`/`ensure` block so
    that in the worst case we don't accidentally clobber anything with
    `cleanup_environment`

1711 of 1944 relevant lines covered (88.01%)

11.45 hits per line

Source Files on job 745.5 (jruby-19mode)
  • Tree
  • List 0
  • Changed 10
  • Source Changed 2
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 745
  • Travis Job 745.5
  • 56f7339c on github
  • Prev Job for jruby-19mode on master (#744.5)
  • Next Job for jruby-19mode on master (#746.5)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc