From 586a57b7610c1c8473959d464e03ff4723b4045c Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Wed, 14 Oct 2020 10:51:25 -0700 Subject: [PATCH] bin: Support old bash in git-branch-prune --- bin/git-branch-prune | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/git-branch-prune b/bin/git-branch-prune index bb7b399..289f1e6 100755 --- a/bin/git-branch-prune +++ b/bin/git-branch-prune @@ -1,6 +1,9 @@ #!/usr/bin/env bash -export USAGE=' +export USAGE=' [-f] + +Flags: + -f, --force Prune branches without confirmation ' # This is the recommended pattern from `man git-sh-setup`. @@ -26,14 +29,13 @@ while [[ $# -gt 0 ]]; do ;; esac done -set -- "${POSITIONAL[@]}" -case "$#" in +case "${#POSITIONAL[@]}" in 0) remote='origin' ;; 1) - remote="$1" + remote="${POSITIONAL[0]}" ;; *) usage ;; esac