Quote arrays to avoid splitting by $IFS

This commit is contained in:
Tom "Ravi" Hale
2018-08-24 08:32:23 +07:00
parent 8a326c2505
commit 5f286eaaaa
8 changed files with 21 additions and 21 deletions

View File

@@ -23,8 +23,8 @@ git_remove_history() {
return
fi
# Remove all paths passed as arguments from the history of the repo
files=$@
$_git_cmd filter-branch --index-filter "$_git_cmd rm -rf --cached --ignore-unmatch $files" HEAD
files=("$@")
$_git_cmd filter-branch --index-filter "$_git_cmd rm -rf --cached --ignore-unmatch ${files[*]}" HEAD
# Remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && $_git_cmd reflog expire --all && $_git_cmd gc --aggressive --prune
}