Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/validate: Fix
git rev-parse
when doing local builds
When doing local builds (i.e. without $DRONE_REPO and $DRONE_PULL_REQUEST, or $DRONE_COMMIT_REF set), the build fails with "fatal: Needed a single revision" in `scripts/validate`: ``` > make REPO=tserong [...] Running validation Running: go vet refs/heads/wip-add-virtualSize fatal: Needed a single revision FATA[0032] exit status 128 make: *** [Makefile:11: ci] Error 1 ``` If I run the commands in `scripts/validate` by hand, I see this: ``` > git symbolic-ref -q HEAD && REV="origin/HEAD" || REV="HEAD^" refs/heads/wip-add-virtualSize > echo $REV origin/HEAD > headSHA=$(git rev-parse --short=12 ${REV}) fatal: Needed a single revision ``` I don't know if this is just something weird about my environment, but if I change "origin/HEAD" to "HEAD", it works fine: ``` > headSHA=$(git rev-parse --short=12 HEAD) > echo $headSHA eb27fbf6e678 ``` Signed-off-by: Tim Serong <[email protected]>
- Loading branch information