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

sds / overcommit / 745
91%

Build:
DEFAULT BRANCH: master
Ran 10 Apr 2015 04:13AM UTC
Jobs 5
Files 105
Run time 4min
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

pending completion
745

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`

1876 of 2123 relevant lines covered (88.37%)

102.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 745.1 (1.9.3) 10 Apr 2015 04:13AM UTC 0
89.22
Travis Job 745.1
2 745.2 (2.0) 10 Apr 2015 04:13AM UTC 0
89.19
Travis Job 745.2
3 745.3 (2.1) 10 Apr 2015 04:13AM UTC 0
89.19
Travis Job 745.3
5 745.5 (jruby-19mode) 10 Apr 2015 04:17AM UTC 0
88.01
Travis Job 745.5
6 745.6 (rbx-2) 10 Apr 2015 04:17AM UTC 0
93.57
Travis Job 745.6
Source Files on build 745
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #745
  • 56f7339c on github
  • Prev Build on master (#744)
  • Next Build on master (#746)
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