- action = determine_action(action, eol_attr);
- ret |= crlf_to_worktree(path, src, len, dst, action);
- if (ret) {
- src = dst->buf;
- len = dst->len;
+ /*
+ * CRLF conversion can be skipped if normalizing, unless there
+ * is a smudge filter. The filter might expect CRLFs.
+ */
+ if (filter || !normalizing) {
+ action = determine_action(action, eol_attr);
+ ret |= crlf_to_worktree(path, src, len, dst, action);
+ if (ret) {
+ src = dst->buf;
+ len = dst->len;
+ }