From f9062c25cbe31fb12adda2f8bb8355992425a2a2 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Mon, 24 Nov 2025 14:16:26 -0800 Subject: [PATCH] Fix running git-update without any args --- git-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-update b/git-update index 4b4e5bf..ab9bd8a 100755 --- a/git-update +++ b/git-update @@ -1,6 +1,6 @@ #!/bin/bash -set -e # bail on errors +set -euo pipefail function current_branch() { git rev-parse --abbrev-ref HEAD | sed -e 's/^heads\///' @@ -13,7 +13,7 @@ if [[ "$ORIG_BRANCH" = "HEAD" ]]; then echo "Cannot update in a detached HEAD state" exit 1 fi -if [[ -z "$2" ]]; then +if [[ -z "${2:-}" ]]; then BRANCHES="$ORIG_BRANCH" else if [[ "$1" = "$REMOTE" ]]; then