ghmerge: Avoid checking out ref branch if not needed
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 7 Oct 2021 14:00:40 +0000 (16:00 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 1 Nov 2021 13:02:08 +0000 (14:02 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/tools/pull/94)

review-tools/ghmerge

index 773a6ddb411f9c32cc1bb923613e863100df56b6..7d1fc257ccd5f0481e19a6554875735bbd2540f8 100755 (executable)
@@ -178,9 +178,8 @@ function cleanup {
 }
 trap 'cleanup' EXIT
 
-if [ "$REF" = "" ]; then
-    REF=$ORIG_REF
-else
+[ "$REF" = "" ] && REF=$ORIG_REF
+if [ "$REF" != "$ORIG_REF" ]; then    
     echo -n "Press Enter to checkout $REF: "; read foo
     git checkout $REF
 fi