From: Nathan Cutler Date: Tue, 3 Sep 2019 13:49:22 +0000 (+0200) Subject: script/ceph-backport.sh: better --prepare verbose messages X-Git-Tag: v15.1.0~1586^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76de400ad1e7b430519204644828490ef36fc03c;p=ceph.git script/ceph-backport.sh: better --prepare verbose messages Signed-off-by: Nathan Cutler --- 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"