From 814caf298e06d40b40134c7b1cdf4a5cf2c927c7 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 19 Jul 2024 10:39:54 +0200 Subject: fix(git2redcrew): don't break on set -u We cannot do `[ -n "$1" ]` when `$1` has not been defined at all. --- git2redcrew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git2redcrew.sh') diff --git a/git2redcrew.sh b/git2redcrew.sh index 142acd7..d4a8b60 100755 --- a/git2redcrew.sh +++ b/git2redcrew.sh @@ -34,7 +34,7 @@ if [ -e .git ] ; then REPO="$(basename "$(git rev-parse --show-toplevel)")" cd .. else - [ -n "$1" ] || exit 1 + [ "$#" -gt 0 ] || exit 1 REPO="$1" (cd "$REPO" git gc --aggressive --prune=now -- cgit