Commit 117fa52e authored by Fabian Müller's avatar Fabian Müller
Browse files

Fix and improve branch update instructions

parent c7d71f70
Loading
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -201,7 +201,12 @@ stages:
  - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)

.check-commits-behind-count-in-compare-jobs: &check-commits-behind-count-in-compare-jobs
  - if [ $commits_behind_count -ne 0 ]; then echo "Your branch is not up-to-date with main -> Compare tests will not run as they can contain false negatives this way.\nMain might have changed during your pipeline run. Run 'git merge origin/main' to update."; exit 1; fi
  - |
    if [ $commits_behind_count -ne 0 ]; then
      echo "Your branch is not up-to-date with main -> Compare tests will not run as they can contain false negatives this way."
      echo "Main might have changed during your pipeline run. Run 'git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME' to update."
      exit 1
    fi

.copy-ltv-files-to-testv-dir: &copy-ltv-files-to-testv-dir
    - cp "$LTV_DIR"/*.wav scripts/testv/
@@ -667,7 +672,11 @@ branch-is-up-to-date-with-target-pre:
  script:
    - *get-commits-behind-count
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, run 'git merge origin/main' to update."; exit 1; fi;
    - |
      if [ $commits_behind_count -ne 0 ]; then
        echo "Your branch is behind the target branch, run 'git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME' to update."
        exit 1
      fi

branch-is-up-to-date-with-target-post:
  extends:
@@ -678,7 +687,11 @@ branch-is-up-to-date-with-target-post:
  script:
    - *get-commits-behind-count
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, possibly main changed during your pipeline run, run 'git merge origin/main' to update." exit 1; fi;
    - |
      if [ $commits_behind_count -ne 0 ]; then
        echo "Your branch is behind the target branch, possibly main changed during your pipeline run, run 'git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME' to update."
        exit 1
      fi


# ---------------------------------------------------------------