]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ceph-backport.sh: check name of current git branch
authorNathan Cutler <ncutler@suse.com>
Wed, 4 Sep 2019 21:16:37 +0000 (23:16 +0200)
committerNathan Cutler <ncutler@suse.com>
Fri, 6 Sep 2019 10:22:53 +0000 (12:22 +0200)
The script expects the git branch containing the cherry-picked commits to be
named using a certain format.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/script/ceph-backport.sh

index 8f1c02c35526eb526f79f9b071fe78ac5c7dca47..0b0f6780d8b0094fc51a6686c9acb2840f0eb803 100755 (executable)
@@ -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