]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
script/ceph-backport.sh: better --prepare verbose messages
authorNathan Cutler <ncutler@suse.com>
Tue, 3 Sep 2019 13:49:22 +0000 (15:49 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 5 Sep 2019 11:07:21 +0000 (13:07 +0200)
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/script/ceph-backport.sh

index 5552137cb68c7105ef2a7582b67be398968dde22..8f57b5b86a8346e81c840cfe2071a7a39e91b1b1 100755 (executable)
@@ -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"