From 9fefeed59c793a4561a2ce9795f2975fe7e8e13f Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 14 May 2018 17:43:51 +0200 Subject: [PATCH] Set default in parameter expasion to avoid do-rebase exit due an unset var The script has set -u so calling do-rebase --help fails with the following: $ ./do-rebase --help ./do-rebase: line 16: $1: unbound variable Avoid this by setting a default value when doing the parameter expansion for the positional parameter $1 passed to the usage() function. Signed-off-by: Javier Martinez Canillas --- do-rebase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/do-rebase b/do-rebase index 032d7f9..ec68118 100755 --- a/do-rebase +++ b/do-rebase @@ -13,7 +13,7 @@ alias formatpatch="othergit format-patch $format_patch_ops" usage() { retcode=0 - if [ -n "$1" ]; then + if [ -n "${1:-}" ]; then exec 1>&2 retcode=$1 fi