872ea5a
From 8b9da98e4c9e256c7c6ecca7f1e5bdbbce29e5da Mon Sep 17 00:00:00 2001
872ea5a
From: Michal Domonkos <mdomonko@redhat.com>
872ea5a
Date: Mon, 11 Jul 2022 13:14:49 +0200
872ea5a
Subject: [PATCH] Use explicit default branch in %autosetup -S git
872ea5a
872ea5a
Commit 3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b assumed "master" as the
872ea5a
default git branch to track, however the name can be changed globally,
872ea5a
so make it explicit.
872ea5a
872ea5a
Given the choice now, go with "main" as the general trend, e.g:
872ea5a
https://fedoraproject.org/wiki/Changes/GitRepos-master-to-main
872ea5a
---
872ea5a
 macros.in | 4 ++--
872ea5a
 1 file changed, 2 insertions(+), 2 deletions(-)
872ea5a
872ea5a
diff --git a/macros.in b/macros.in
872ea5a
index 406622d2f..cf4f77331 100644
872ea5a
--- a/macros.in
872ea5a
+++ b/macros.in
872ea5a
@@ -1163,7 +1163,7 @@ package or when debugging this package.\
872ea5a
 
872ea5a
 # Git
872ea5a
 %__scm_setup_git(q)\
872ea5a
-%{__git} init %{-q}\
872ea5a
+%{__git} init %{-q} --initial-branch=main\
872ea5a
 %{__git} config user.name "%{__scm_username}"\
872ea5a
 %{__git} config user.email "%{__scm_usermail}"\
872ea5a
 %{__git} config gc.auto 0\
872ea5a
@@ -1172,7 +1172,7 @@ package or when debugging this package.\
872ea5a
 	--author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"\
872ea5a
 %{__git} branch rpm-build \
872ea5a
 %{__git} checkout rpm-build \
872ea5a
-%{__git} branch --set-upstream-to=master
872ea5a
+%{__git} branch --set-upstream-to=main
872ea5a
 
872ea5a
 %__scm_apply_git(qp:m:)\
872ea5a
 %{__git} apply --index --reject %{-p:-p%{-p*}} -\
872ea5a
-- 
872ea5a
2.36.1
872ea5a