git: Move ‘core.autocrlf’ settings.

Follow up of b5e567bb2b.

* guix/git.scm (clone*): Move ‘core.autocrlf’ settings from here...
(update-cached-checkout): ...to here.

Change-Id: I0f91d348376f9953cfbc497148596b738705818b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Simon Tournier 2025-04-15 17:57:00 +02:00 committed by Ludovic Courtès
parent 831a3b1263
commit 4b68cbbb8d
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -228,12 +228,7 @@ make sure no empty directory is left behind."
(make-clone-options
#:fetch-options (make-default-fetch-options
#:verify-certificate?
verify-certificate?))))
(config (repository-config repository)))
;; Override 'core.autocrlf' as set in ~/.gitconfig to ensure files are
;; left unchanged when cloning and pulling.
(set-config-string config "core.autocrlf" "input")
verify-certificate?)))))
repository))
(lambda _
(false-if-exception (rmdir directory)))))
@ -592,7 +587,12 @@ current settings unchanged."
(repository-open cache-directory)
(clone/swh-fallback url ref cache-directory
#:verify-certificate?
verify-certificate?))))
verify-certificate?)))
(config (repository-config repository)))
;; Override 'core.autocrlf' as set in ~/.gitconfig to ensure files are
;; left unchanged when cloning and pulling.
(set-config-string config "core.autocrlf" "input")
;; Only fetch remote if it has not been cloned just before.
(when (and cache-exists?
(not (reference-available? repository ref)))