[openwrt/openwrt] scripts/env: fix env for git conf init.defaultBranch not set to "master"

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 13 12:29:58 PST 2021


aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b5ab6d0bc577e81a77f39211883f6c0c4155b6ed

commit b5ab6d0bc577e81a77f39211883f6c0c4155b6ed
Author: Arne Zachlod <arne at nerdkeller.org>
AuthorDate: Wed Nov 10 14:47:55 2021 +0100

    scripts/env: fix env for git conf init.defaultBranch not set to "master"
    
    Since version 2.28, git has a config option init.defaultBranch to set the name
    of the first branch created with git init. The env script expects this name to
    be "master". This commit sets the initial branch name to "master"
    instead of using the git configured one.
    
    Signed-off-by: Arne Zachlod <arne at nerdkeller.org>
---
 scripts/env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/env b/scripts/env
index df8b486bfe..5987b4160f 100755
--- a/scripts/env
+++ b/scripts/env
@@ -61,7 +61,7 @@ env_init() {
 	mkdir -p "$ENVDIR" || error "Failed to create the environment directory"
 	cd "$ENVDIR" || error "Failed to switch to the environment directory"
 	[ -d .git ] || { 
-		git init &&
+		git init -b master &&
 		touch .config &&
 		mkdir files &&
 		git add . && 



More information about the lede-commits mailing list