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

jcgay / protector / 20
19%

Build:
DEFAULT BRANCH: master
Ran 14 Oct 2017 08:55AM UTC
Jobs 1
Files 3
Run time 0s
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
20

push

travis-ci

jcgay
Correctly get branch protection status

It seems that the ListBranches endpoint (https://api.github.com/repos/softwarevidal/a*****r/branches)
was returning a protected status but it does not anymore...
Instead we have to call GetBranch (https://api.github.com/repos/softwarevidal/a*****r/branches/master) for each branch to read its protection status.

Fixes #8

Before this commit the application was failing with:

    > ./protector -dry-run -repos softwarevidal/a****r -token $GITHUB_TOKEN

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12376d2]

    goroutine 40 [running]:
    main.(*githubProtection).lock(0xc420086230, 0xc420120000, 0xc42020db40, 0x102d3ea, 0x0, 0xc4202e1720, 0x0)
    	/Users/jcgay/dev/golang/src/github.com/jcgay/protector/protection.go:90 +0x32
    main.(*githubProtection).protect.func1(0xc42020db40, 0xc420120000, 0xc420122050, 0x1, 0x1)
    	/Users/jcgay/dev/golang/src/github.com/jcgay/protector/protection.go:50 +0x3d
    main.(*githubProtection).process(0xc420086230, 0xc420120000, 0xc420053f78)
    	/Users/jcgay/dev/golang/src/github.com/jcgay/protector/protection.go:39 +0x170
    main.(*githubProtection).protect(0xc420086230, 0xc420120000)
    	/Users/jcgay/dev/golang/src/github.com/jcgay/protector/protection.go:49 +0x55
    main.main.func2(0xc4200185c0, 0xc420086230, 0xc420120000)
    	/Users/jcgay/dev/golang/src/github.com/jcgay/protector/protector.go:129 +0x92
    created by main.main
    	/Users/jcgay/dev/golang/src/github.com/jcgay/protector/protector.go:123 +0x6d7

50 of 263 relevant lines covered (19.01%)

0.21 hits per line

Jobs
ID Job ID Ran Files Coverage
1 20.1 14 Oct 2017 08:55AM UTC 0
19.01
Travis Job 20.1
Source Files on build 20
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #20
  • 8e48120f on github
  • Prev Build on master (#19)
  • Next Build on master (#21)
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