From: Nathan Cutler Date: Thu, 5 Sep 2019 11:18:31 +0000 (+0200) Subject: script/ceph-backport.sh: checkout local branch if not in it already X-Git-Tag: v15.1.0~1586^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=447f47cc0cba507abc4968ba143cb8dd85648dcd;p=ceph.git script/ceph-backport.sh: checkout local branch if not in it already Signed-off-by: Nathan Cutler --- diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index 2384191216e1..4c34e14ad2de 100755 --- a/src/script/ceph-backport.sh +++ b/src/script/ceph-backport.sh @@ -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