]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ceph-backport.sh: better error message when remote missing
authorNathan Cutler <ncutler@suse.com>
Tue, 3 Sep 2019 13:32:16 +0000 (15:32 +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 e40ee55ccf1aab306967058a757d78d21b4be205..c19b65e69174903b746c158ff74c520b50fe5a6b 100755 (executable)
@@ -286,9 +286,19 @@ if [ $verbose ] ; then
     debug "Redmine user: ${redmine_user_id}"
     debug "GitHub user:  ${github_user}"
     debug "Fork remote:  ${github_repo}"
-    git remote -v | egrep ^${github_repo}\\s+
+    if git remote -v | egrep ^${github_repo}\\s+ ; then
+        true  # remote exists; good
+    else
+        error "github_repo is set to ->$github_repo<- but this remote does not exist"
+        exit 1
+    fi
     debug "Ceph remote:  ${ceph_repo}"
-    git remote -v | egrep ^${ceph_repo}\\s+
+    if git remote -v | egrep ^${ceph_repo}\\s+ ; then
+        true  # remote exists; good
+    else
+        error "ceph_repo is set to ->$ceph_repo<- but this remote does not exist"
+        exit 1
+    fi
 fi
 
 if [[ $1 =~ ^[0-9]+$ ]] ; then