Subject: Re: bug#65049: Minor update to the repro steps

From: Eli Zaretskii <[email-masked]>
Date: Sun, 20 Aug 2023 21:25:56 +0300

> From: Juri Linkov <[email-masked]>
> Cc: Maxim Kim <[email-masked]>,  [email-masked]
> Date: Sun, 20 Aug 2023 19:49:53 +0300
> 
> > Yes, but where did the file git-patchyYAcN5 come from in the first
> > place?  It's that file that is the problem, not how we apply the
> > diffs in that file.
> 
> It's created in 'vc-git-checkin':
> 
>         (let ((patch-file (make-nearby-temp-file "git-patch")))
>           (with-temp-file patch-file
>             (insert vc-git-patch-string))
>           (unwind-protect
>               (vc-git-command nil 0 patch-file "apply" "--cached")

Then this should set up EOL conversion correctly for the temporary
file.  Something like (untested):

        (let ((patch-file (make-nearby-temp-file "git-patch")))
          (with-temp-file patch-file
            (insert vc-git-patch-string)
            (set-buffer-file-coding-system 'unix)))
          (unwind-protect
              (vc-git-command nil 0 patch-file "apply" "--cached")