aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-06-11 21:52:17 +0300
committerEfraim Flashner <efraim@flashner.co.il>2023-07-05 18:57:29 +0300
commitc7eed71681501afa494e8640c3cdd080cadf8290 (patch)
tree2ced4840ae1342eb360bbf959de19ef99b34468b
parenta00e1ee3104936a46ab71507cc6287bbbe4dfa99 (diff)
downloadguix-c7eed71681501afa494e8640c3cdd080cadf8290.tar
guix-c7eed71681501afa494e8640c3cdd080cadf8290.tar.gz
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.
-rw-r--r--guix/build/git.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/guix/build/git.scm b/guix/build/git.scm
index 669e38cd32..deda10fee8 100644
--- a/guix/build/git.scm
+++ b/guix/build/git.scm
@@ -52,7 +52,7 @@ recursively. Return #t on success, #f otherwise."
(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")