From 969973a7d234d4c26ff4dd569830e49ceeab536f Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Sun, 24 Jul 2022 21:54:29 -0700 Subject: CI: Fix comments in shell script This comment didn't make sense where it was placed, put it next to the code that it refers to. --- test/test-ci.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/test-ci.sh b/test/test-ci.sh index dd61e17e..58918b7c 100755 --- a/test/test-ci.sh +++ b/test/test-ci.sh @@ -39,6 +39,8 @@ do_Get_Upstream_Base () { # should probably be rebased. git remote add upstream https://gitlab.gnome.org/GNOME/gjs.git || \ git remote set-url upstream https://gitlab.gnome.org/GNOME/gjs.git + # $CI_MERGE_REQUEST_TARGET_BRANCH_NAME is only defined if we’re running in a + # merge request pipeline; fall back to $CI_DEFAULT_BRANCH otherwise. base_branch="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}" if ! git fetch --shallow-since="28 days ago" --no-tags upstream "$base_branch"; then echo "Main branch doesn't have history in the past 28 days, fetching " @@ -51,9 +53,6 @@ do_Get_Upstream_Base () { # Work out the newest common ancestor between the detached HEAD that this CI # job has checked out, and the upstream target branch (which will typically # be `upstream/master` or `upstream/gnome-nn`). - # - # $CI_MERGE_REQUEST_TARGET_BRANCH_NAME is only defined if we’re running in a - # merge request pipeline; fall back to $CI_DEFAULT_BRANCH otherwise. newest_common_ancestor_sha=$(git merge-base ci-upstream-base-branch HEAD) if test -z "$newest_common_ancestor_sha"; then echo "Couldn’t find common ancestor with the upstream main branch. This" -- cgit v1.2.1