Set core.autocrlf = true in repos on Windows #2637

Line encoding issues can plague repos with dirty worktree prompts
updating packages or "Local variables entry is missing the suffix"
errors when installing them.
This commit is contained in:
Henrik Lissner 2020-07-24 00:48:05 -04:00
parent 976a601750
commit 9ec5428441
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -143,7 +143,16 @@ declaration) or dependency thereof that hasn't already been."
(when-let (commit (cdr (assoc pkg pinned)))
(print! (info "Checked out %s") commit)))
straight-use-package-pre-build-functions)))
(straight-use-package (intern package)))
(straight-use-package (intern package))
;; HACK Line encoding issues can plague repos with dirty
;; worktree prompts when updating packages or "Local
;; variables entry is missing the suffix" errors when
;; installing them (see hlissner/doom-emacs#2637), so
;; have git handle conversion by force.
(when (and IS-WINDOWS (stringp local-repo))
(let ((default-directory (straight--repos-dir local-repo)))
(when (file-in-directory-p default-directory straight-base-dir)
(straight--call "git" "config" "core.autocrlf" "true")))))
(error
(signal 'doom-package-error (list package e))))))
(print! (success "Installed %d packages")