summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJustin Tobler <jltobler@gmail.com>2025-01-31 11:39:38 -0600
committerJunio C Hamano <gitster@pobox.com>2025-01-31 10:08:46 -0800
commitacc4fb302b8c5eecf127b1cd91e2fa1ff477bf87 (patch)
treeec80b6d472d47e9c726a9227a1c223843d93139b /commit.c
parentf93ff170b93a1782659637824b25923245ac9dd1 (diff)
ci: fix base commit fallback for check-whitespace and check-style
The check-whitespace and check-style CI scripts require a base commit. In GitLab CI, the base commit can be provided by several different predefined CI variables depending on the type of pipeline being performed. In 30c4f7e350 (check-whitespace: detect if no base_commit is provided, 2024-07-23), the GitLab check-whitespace CI job was modified to support CI_MERGE_REQUEST_DIFF_BASE_SHA as a fallback base commit if CI_MERGE_REQUEST_TARGET_BRANCH_SHA was not provided. The same fallback strategy was also implemented for the GitLab check-style CI job in bce7e52d4e (ci: run style check on GitHub and GitLab, 2024-07-23). The base commit fallback is implemented using shell parameter expansion where, if the first variable is unset, the second variable is used as fallback. In GitLab CI, these variables can be set but null. This has the unintended effect of selecting an empty first variable which results in CI jobs providing an invalid base commit and failing. Fix the issue by defaulting to the fallback variable if the first is unset or null. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions