me
/
guix
Archived
1
0
Fork 0

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.
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
1 changed files with 1 additions and 1 deletions

View File

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