Skip to content

Commit b4473c1

Browse files
committed
fix: use array for rev-list range in git-obliterate
1 parent 1bde67f commit b4473c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/git-obliterate

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ do
99
file="$file"' '"$i"
1010
shift
1111
done
12-
test -n "$*" && range="$*"
12+
test -n "$*" && range=("$@")
1313

1414
test -z "$file" && echo "file required." 1>&2 && exit 1
15-
if [ -z "$range" ]
15+
if [ -z "${range[*]}" ]
1616
then
1717
git filter-branch -f --index-filter "git rm -r --cached ""$file"" --ignore-unmatch" \
1818
--prune-empty --tag-name-filter cat -- --all
1919
else
20-
# don't quote $range so that we can forward multiple rev-list arguments
20+
# $range is an array so that we can forward multiple rev-list arguments
2121
git filter-branch -f --index-filter "git rm -r --cached ""$file"" --ignore-unmatch" \
22-
--prune-empty --tag-name-filter cat -- "$range"
22+
--prune-empty --tag-name-filter cat -- "${range[@]}"
2323
fi

0 commit comments

Comments
 (0)