From 1098d568b36adebdf52bf0f11420e6ec03e88c2c Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Nov 2026 21:05:18 +0000 Subject: populate git: name the initial branch of shallow clones git init, which makes the repository of a shallow clone, advises at length to choose a name for the initial branch, unless init.defaultBranch is set. Setting it for git init alone keeps that quiet, and out of the repository's configuration. --- pkgs/populate/src/sh.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkgs') diff --git a/pkgs/populate/src/sh.rs b/pkgs/populate/src/sh.rs index 1f27b6b..52d41ac 100644 --- a/pkgs/populate/src/sh.rs +++ b/pkgs/populate/src/sh.rs @@ -515,7 +515,9 @@ deliver_git() { if ! test -e "$path"; then changed=1 if test -n "$shallow"; then - git init "$path" + # With a name for the initial branch, so Git doesn't advise to choose + # one. + git -c init.defaultBranch=master init "$path" else git clone --recurse-submodules -- "$url" "$path" fi -- cgit v1.3.1