GitLab CI: Fix Commit Check gitrevision for multiple commits

commit^N means the Nth parent of a commit object (after a merge,
for example.) It is not the same as the Nth generation ancestor
(following only the first parents), which is commit~N, or
alternatively commit^^^^^ (N times), or even commit^1^1^1....
(See 'man gitrevisions' for details.)
When the number of commits is N, we want the Nth generation ancestor.

Fixes error messages like:
fatal: ambiguous argument 'HEAD^3': unknown revision or path not
in the working tree.
This commit is contained in:
John Thacker 2022-01-19 07:48:40 -05:00 committed by A Wireshark GitLab Utility
parent 73b94e7aef
commit 0729f96fdd
1 changed files with 1 additions and 1 deletions

View File

@ -532,7 +532,7 @@ Commit Check:
script:
# build-ubuntu puts us in `build`.
- cd ..
- bash ./tools/pre-commit "HEAD^$NUM_COMMITS"
- bash ./tools/pre-commit "HEAD~$NUM_COMMITS"
- tools/validate-commit.py
# Rely on fedora:latest and debian-stable jobs for testing a recent GCC version.