]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ceph-backport.sh: checkout local branch if not in it already
authorNathan Cutler <ncutler@suse.com>
Thu, 5 Sep 2019 11:18:31 +0000 (13:18 +0200)
committerNathan Cutler <ncutler@suse.com>
Fri, 6 Sep 2019 10:47:30 +0000 (12:47 +0200)
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/script/ceph-backport.sh

index 2384191216e19b74cf0a489c42cba0bb4f0411e8..4c34e14ad2de9d8ec73bcac90d877dbbf7638a31 100755 (executable)
@@ -487,6 +487,9 @@ fi
 # at this point, local branch exists and is assumed to contain cherry-pick(s)
 #
 
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+[ "$current_branch" = "$local_branch" ] || git checkout $local_branch
+
 debug "Pushing local branch $local_branch to remote $fork_remote"
 git push -u $fork_remote $local_branch