X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fbranch.sh;h=37900eab01114ee111beae72d053499fc16653d2;hb=76b132e25f228918b78812aea0a8d4fe5bf79501;hp=558a2b617ebc057bf95bfa330ec87ce3b6b898c1;hpb=36d56bdb7f9f394047e2df3f29bf47db877b649c;p=csit.git diff --git a/resources/libraries/bash/function/branch.sh b/resources/libraries/bash/function/branch.sh index 558a2b617e..37900eab01 100644 --- a/resources/libraries/bash/function/branch.sh +++ b/resources/libraries/bash/function/branch.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -28,6 +28,11 @@ function checkout_csit_for_vpp () { # When the refspec is overriden, the computation is still performed, # in order to show (on Sandbox) the computation is correct. # + # Git status and git log -1 are executed, so the current state + # of the checked-out branch is visible. + # This is mainly useful for identifying trending anomalies + # caused by changes in CSIT code. + # # On failure, working directory could remain changed to ${CSIT_DIR}. # TODO: It could be possible to use ERR trap to force popd, # but with "set -x" the noise is not worth it, @@ -55,6 +60,9 @@ function checkout_csit_for_vpp () { "stable/"*) branch_id="origin/${1/stable\//oper-rls}" ;; + "rls"*) + branch_id="origin/oper-${1}" + ;; *) # This includes "master". branch_id="origin/oper" esac @@ -79,5 +87,7 @@ function checkout_csit_for_vpp () { else git checkout "${csit_branch}" || die fi + git status || die + git log -1 || die popd || die }