diff mbox series

[bug#64009] guix: git: Set initial branch name for git-fetch.

Message ID d602a82c542d34aa91ea39cde9bda16a713c059c.1686509642.git.efraim@flashner.co.il
State New
Headers show
Series [bug#64009] guix: git: Set initial branch name for git-fetch. | expand

Commit Message

Efraim Flashner June 11, 2023, 6:54 p.m. UTC
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.
---
 guix/build/git.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 73fa2889895f35bcf0c41f1174413381fdd7ec2c

Comments

Efraim Flashner July 6, 2023, 1:21 p.m. UTC | #1
Patch pushed
diff mbox series

Patch

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 @@  (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")