TRAVIS_COMMIT is not the commit initially checked out

It seems that it’s not the case: see the following commands, which always display the same merge commit SHA-1:

$ git ls-remote https://github.com/mlocati/ci-info.git refs/pull/10/merge
69825df7c60b46c8849a1818df05e19de95513cd        refs/pull/10/merge
$ git ls-remote https://github.com/mlocati/ci-info.git refs/pull/10/merge
69825df7c60b46c8849a1818df05e19de95513cd        refs/pull/10/merge
$ git clone --quiet --depth=50 https://github.com/mlocati/ci-info.git tmp
$ git -C tmp fetch --quiet origin +refs/pull/10/merge:
$ git -C tmp checkout -qf FETCH_HEAD
$ git -C tmp log --max-count=1 --format=format:%H HEAD
69825df7c60b46c8849a1818df05e19de95513cd
$ rm -rf tmp
$ git clone --quiet --depth=50 https://github.com/mlocati/ci-info.git tmp
$ git -C tmp fetch --quiet origin +refs/pull/10/merge:
$ git -C tmp checkout -qf FETCH_HEAD
$ git -C tmp log --max-count=1 --format=format:%H HEAD
69825df7c60b46c8849a1818df05e19de95513cd
$ rm -rf tmp
$ git ls-remote https://github.com/mlocati/ci-info.git refs/pull/10/merge
69825df7c60b46c8849a1818df05e19de95513cd        refs/pull/10/merge
$ git ls-remote https://github.com/mlocati/ci-info.git refs/pull/10/merge
69825df7c60b46c8849a1818df05e19de95513cd        refs/pull/10/merge
2 Likes