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

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

Build:
DEFAULT BRANCH: master
Ran 10 Apr 2015 04:13AM UTC
Files 105
Run time 5s
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: 89.192% (+0.006%) from 89.186%
2.1

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`

1700 of 1906 relevant lines covered (89.19%)

24.29 hits per line

Source Files on job 745.3 (2.1)
  • 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.3
  • 56f7339c on github
  • Prev Job for 2.1 on master (#744.3)
  • Next Job for 2.1 on master (#746.3)
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