TRAVIS_COMMIT is not the commit initially checked out

I think I know what’s happening. For a PR build, Travis actually retrieves origin/refs/pull/<PR#>/merge – a “merge preview” commit generated by Github.

Looks like it’s generated anew each time the PR branch or the base branch changes:

I don’t know if there’s some other way to retrieve that merge preview commit that would allow one to retrieve an earlier version of it that would correspond to the time the specific PR commit was pushed.