ghmerge: Automatically detect remote only if not explicitly given as option
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 8 Oct 2020 13:38:58 +0000 (15:38 +0200)
committerPauli <paul.dale@oracle.com>
Mon, 16 Nov 2020 09:31:51 +0000 (19:31 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/72)

review-tools/ghmerge

index b2bb071863737dd7d350c0b934968d0233fa6ef9..35ac8f82c11fd4426f75620ff88f8212b6e875e0 100755 (executable)
@@ -7,11 +7,7 @@ BUILD=yes
 INTERACTIVE=yes
 AUTOSQUASH="--autosquash"
 [ -z ${CC+x} ] && CC="ccache gcc" # the default otherwise is "ccache clang-3.6"
-REMOTE=`git remote -v | awk '/git.openssl.org.*(push)/{ print $1; }' | head -n 1`
-if [ "$REMOTE" = "" ] ; then
-    echo Cannot find git remote with URL including 'git.openssl.org'
-    exit 1
-fi
+REMOTE=""
 REL=""
 
 if [ ! -d .git ] ; then
@@ -89,6 +85,12 @@ while [ $# -ne 0 ]; do
 done
 ADDREVOPTS=${ADDREVOPTS# } # chop any leading ' '
 
+[ "$REMOTE" = "" ] && REMOTE=`git remote -v | awk '/git.openssl.org.*(push)/{ print $1; }' | head -n 1`
+if [ "$REMOTE" = "" ] ; then
+    echo Cannot find git remote with URL including 'git.openssl.org'
+    exit 1
+fi
+
 if [ "$PRNUM" = "" -o "$TEAM" = "" ] ; then
     echo "Usage: $0 [flags, including addrev options] prnum reviewer..."
     exit 1