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

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

Build:
DEFAULT BRANCH: master
Ran 10 Apr 2015 04:17AM UTC
Files 96
Run time 6s
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: 93.572% (+0.003%) from 93.569%
rbx-2

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`

1776 of 1898 relevant lines covered (93.57%)

29.96 hits per line

Source Files on job 745.6 (rbx-2)
  • Tree
  • List 0
  • Changed 6
  • Source Changed 2
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 745
  • Travis Job 745.6
  • 56f7339c on github
  • Prev Job for rbx-2 on master (#744.6)
  • Next Job for rbx-2 on master (#746.6)
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