From bee0342f35412709821b1bfbf1a0c9974508cf85 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sat, 19 Aug 2023 22:49:52 +0200 Subject: [PATCH] fix branch check in CI (#5326) Use explicit refs to avoid occasional issues with branch check reporting incorrectly that commit is not an ancestor of upstream head. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbea19d9a..94ed51a2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,11 +222,11 @@ jobs: echo "Submodule '$file': '.gitmodules' lacks 'branch' entry" exit 2 fi - if ! error="$(git -C "$file" fetch -q origin "$branch")"; then + if ! error="$(git -C "$file" fetch -q origin "+refs/heads/$branch:refs/remotes/origin/$branch")"; then echo "Submodule '$file': Failed to fetch '$branch': $error" exit 2 fi - if ! git -C "$file" merge-base --is-ancestor "$commit" "origin/$branch"; then + if ! git -C "$file" merge-base --is-ancestor "$commit" "refs/remotes/origin/$branch"; then echo "Submodule '$file': '$commit' is not on '$branch'" exit 2 fi