Skip to content

Commit

Permalink
🐛 misc(pre-commit hook): handle filenames with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Jun 20, 2024
1 parent faa9633 commit 448250f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ fi
##################################################################

# Get the newly added and modified files.
all_changed_files=$(git diff --cached --name-only --diff-filter=AM)
mapfile -t all_changed_files < <(git diff --cached --name-only)

script_name=$(basename "$0")
# Loop through all newly added or modified files.
for file in $all_changed_files; do
for file in "${all_changed_files[@]}"; do
file_name=$(basename "$file")

# Ignore this script and the changelog.
Expand Down

0 comments on commit 448250f

Please sign in to comment.