From d6caf33c6f3654b633af1af5a20ebf25108cccf4 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Tue, 11 Mar 2025 01:36:09 +0100 Subject: [PATCH] util/scripts/update_submodules: Rework default branch detection Instead of guessing the default branch by iterating over a list of branch names, use the branch that is configured as default by upstream. Change-Id: I628b5a4e5228870c54719577e32dae169b0ceb2e Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/86803 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- util/scripts/update_submodules | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/util/scripts/update_submodules b/util/scripts/update_submodules index 48bb7f71bb..cbf2364ebe 100755 --- a/util/scripts/update_submodules +++ b/util/scripts/update_submodules @@ -108,13 +108,7 @@ main() { git fetch 2>/dev/null fi - declare -a branches=("origin/main" "origin/master" "origin/trunk") - for branch in "${branches[@]}"; do - if git branch -a | grep "${branch}" > /dev/null; then - branch_name="${branch}" - break - fi - done + branch_name="$(git symbolic-ref refs/remotes/origin/HEAD --short)" updated_commit_id="$(git log --pretty='%h' -n 1 --abbrev=12 "${branch_name}" -- )" updated_commit_description="$(git log --pretty='%ci - (%s)' -n 1 "${updated_commit_id}")"