From: Nathan Cutler Date: Wed, 4 Sep 2019 21:16:37 +0000 (+0200) Subject: script/ceph-backport.sh: check name of current git branch X-Git-Tag: v15.1.0~1586^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce0daf5f41bea37ca8541f5e1335e16a87de35b0;p=ceph.git script/ceph-backport.sh: check name of current git branch The script expects the git branch containing the cherry-picked commits to be named using a certain format. Signed-off-by: Nathan Cutler --- diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index 8f1c02c35526..0b0f6780d8b0 100755 --- a/src/script/ceph-backport.sh +++ b/src/script/ceph-backport.sh @@ -403,17 +403,19 @@ debug "Milestone number is $milestone_number" local_branch=wip-${issue}-${target_branch} -if [ $(curl --silent ${redmine_url}.json | jq -r .issue.tracker.name) != "Backport" ] -then - error "${redmine_endpoint}/issues/${issue} is not in the Backport tracker" - exit 1 -fi - if [ "$PREPARE" ]; then debug "'--prepare' found, will only prepare the backport" prepare fi +current_branch=$(git rev-parse --abbrev-ref HEAD) +if [ "$current_branch" = "$local_branch" ] ; then + true # all is well +else + error "local branch is $current_branch, but I needed $local_branch" + exit 1 +fi + debug "Pushing local branch $local_branch to remote $github_repo" git push -u $github_repo $local_branch