Skip to content

Commit ed63a71

Browse files
committed
safer filename handling
1 parent 68337ee commit ed63a71

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ runs:
133133
echo "Creating orphan 'coverage' branch..."
134134
git checkout "${BRANCH}"
135135
git checkout --orphan coverage
136-
# remove index entries (keep working tree)
137-
if [[ -n "$(git ls-files)" ]]; then
138-
git rm --cached $(git ls-files)
139-
fi
136+
# Remove index entries (keep working tree) in a filename-safe way.
137+
while IFS= read -r -d '' path; do
138+
git rm --cached -- "$path"
139+
done < <(git ls-files -z)
140140
echo '# Coverage branch' > README.md
141141
git add README.md
142142
git commit -m 'Add README.md'

0 commit comments

Comments
 (0)