From 76de400ad1e7b430519204644828490ef36fc03c Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Tue, 3 Sep 2019 15:49:22 +0200 Subject: [PATCH] script/ceph-backport.sh: better --prepare verbose messages Signed-off-by: Nathan Cutler --- src/script/ceph-backport.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index 5552137cb68..8f57b5b86a8 100755 --- a/src/script/ceph-backport.sh +++ b/src/script/ceph-backport.sh @@ -259,11 +259,18 @@ function prepare { fi info "Found $number commits in ${original_pr_url}" + debug "Fetching latest commits from $ceph_repo" git fetch $ceph_repo - debug "Fetched latest commits from upstream" - git checkout $ceph_repo/$milestone -b $local_branch + debug "Initializing local branch $local_branch to $milestone" + if git show-ref --verify --quiet refs/heads/$local_branch ; then + error "Cannot initialize $local_branch - local branch already exists" + exit 1 + else + git checkout $ceph_repo/$milestone -b $local_branch + fi + debug "Fetching latest commits from ${original_pr_url}" git fetch $ceph_repo pull/$original_pr/head:pr-$original_pr debug "Cherry picking $number commits from ${original_pr_url} into local branch $local_branch" -- 2.39.5