guix: git: Set initial branch name for git-fetch.

This removes the 'hint' about choosing a branch name when creating a new
git repository.

* guix/build/git.scm (git-fetch): When running 'git init' add an initial
branch name.
This commit is contained in:
Efraim Flashner 2023-06-11 21:52:17 +03:00
parent a00e1ee310
commit c7eed71681
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -52,7 +52,7 @@ (define* (git-fetch url commit directory
(delete-file-recursively directory)
#f))
(with-directory-excursion directory
(invoke git-command "init")
(invoke git-command "init" "--initial-branch=main")
(invoke git-command "remote" "add" "origin" url)
(if (zero? (system* git-command "fetch" "--depth" "1" "origin" commit))
(invoke git-command "checkout" "FETCH_HEAD")