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.
parent
a00e1ee310
commit
c7eed71681
|
@ -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")
|
||||||
|
|
Reference in New Issue