fix: handle space in changed file name

This commit is contained in:
sksat
2021-11-24 00:30:10 +09:00
parent 0b655e298c
commit b90e27731a

View File

@@ -93,10 +93,13 @@ if _git_changed; then
if $INPUT_ONLY_CHANGED; then
# --diff-filter=d excludes deleted files
OLDIFS="$IFS"
IFS=$'\n'
for file in $(git diff --name-only --diff-filter=d HEAD^..HEAD)
do
git add $file
git add "$file"
done
IFS="$OLDIFS"
else
# Add changes to git
git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}"