guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Efraim Flashner
Subject: [bug#64009] [PATCH] guix: git: Set initial branch name for git-fetch.
Date: Sun, 11 Jun 2023 21:54:12 +0300

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

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

base-commit: 73fa2889895f35bcf0c41f1174413381fdd7ec2c
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted






reply via email to

[Prev in Thread] Current Thread [Next in Thread]