From 447f47cc0cba507abc4968ba143cb8dd85648dcd Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Thu, 5 Sep 2019 13:18:31 +0200 Subject: [PATCH] script/ceph-backport.sh: checkout local branch if not in it already Signed-off-by: Nathan Cutler --- src/script/ceph-backport.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index 2384191216e..4c34e14ad2d 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 -- 2.39.5