Skip to content

Commit bfd0eec

Browse files
authored
Fix detection of C header files
1 parent b05f974 commit bfd0eec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-fmt-diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ detect_filetype () (
268268
if [ -z "$ft" ] && [ -x "$(command -v vim)" ]; then
269269
vim --clean -es \
270270
+'let c_syntax_for_h = 1' \
271+
+"e $1" \
271272
+'exec "!echo ".&ft' \
272-
+"quit!" \
273-
"$1"
273+
+"quit!"
274274
fi
275275

276276
echo "$ft"
@@ -288,6 +288,7 @@ git_changes_formatted () (
288288
temp="$tempdir"/temp
289289

290290
rm_list__push "$temp"
291+
rm_list__push "$diff_fmt"
291292

292293
if git diff -s "$cur_fmt" "$old_fmt"; then
293294
merge --our "$cur" "$old" "$cur_fmt" > "$temp"
@@ -297,7 +298,6 @@ git_changes_formatted () (
297298
fi
298299

299300
merge --their "$old" "$old_fmt" "$cur_fmt" > "$diff_fmt"
300-
rm_list__push "$diff_fmt"
301301

302302
merge --our "$diff_fmt" "$old" "$cur" > "$temp"
303303
if ! git diff -s "$diff_fmt" "$temp"; then

0 commit comments

Comments
 (0)