Git shallow clone followed by checkout -cf $hash fails my build

github-integration

#1

What happened here: I made some changes to my GitHub repo and pushed it. Minutes after, I went back and updated the README and pushed again.

Then I’ve got this error on my build:

https://travis-ci.org/fiorix/jsonschema2go/jobs/452139839#L55

I believe what’s happening is that the shallow clone, depth=1, only has my latest (head) commit bcd91 and not the previous, dd7488, which is the changeset being tested.

The subsequent build for bcd91 worked just fine, as expected: https://travis-ci.org/fiorix/jsonschema2go/builds/452142874

There may be some intermittent issue where people push too fast and their tests fail.


#2

This is explained in our document. You should really define a value higher than 1 for the depth.