Skip to content

Commit 3d1cde8

Browse files
committed
Fix eval
1 parent 5c58080 commit 3d1cde8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

git-fmt-diff

+6-2
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,17 @@ process_file () (
393393
return
394394
fi
395395

396+
fmtcmd="$tempdir"/fmtcmd
397+
rm_list__push "$fmtcmd"
398+
echo "$formatter" > "$fmtcmd"
399+
396400
# shellcheck disable=SC2086
397-
eval "sh -c '$formatter' < '$b_raw' > '$b_fmt' $g_fmtprg_devnull"
401+
eval "sh '$fmtcmd' < '$b_raw' > '$b_fmt' $g_fmtprg_devnull"
398402
rm_list__push "$b_fmt"
399403

400404
git diff -s "$b_raw" "$b_fmt" && return
401405

402-
eval "sh -c '$formatter' < '$a_raw' > '$a_fmt' $g_fmtprg_devnull"
406+
eval "sh '$fmtcmd' < '$a_raw' > '$a_fmt' $g_fmtprg_devnull"
403407
rm_list__push "$a_fmt"
404408

405409
chng_fmt="$(git_changes_formatted \

0 commit comments

Comments
 (0)