unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] solver_git: support non-master git default branch
@ 2021-10-26 22:13 Thomas Weißschuh
  2021-10-27  4:20 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Weißschuh @ 2021-10-26 22:13 UTC (permalink / raw)
  To: meta; +Cc: Thomas Weißschuh

---
 lib/PublicInbox/SolverGit.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 5d5060f4..f9ce3793 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -18,6 +18,7 @@ use PublicInbox::Qspawn;
 use PublicInbox::Tmpfile;
 use PublicInbox::GitAsyncCat;
 use PublicInbox::Eml;
+use PublicInbox::Import;
 use URI::Escape qw(uri_escape_utf8);
 
 # POSIX requires _POSIX_ARG_MAX >= 4096, and xargs is required to
@@ -26,6 +27,7 @@ use URI::Escape qw(uri_escape_utf8);
 use POSIX qw(sysconf _SC_ARG_MAX);
 my $ARG_SIZE_MAX = (sysconf(_SC_ARG_MAX) || 4096) - 2048;
 my $OID_MIN = 7;
+my $default_branch = PublicInbox::Import::default_branch;
 
 # By default, "git format-patch" generates filenames with a four-digit
 # prefix, so that means 9999 patch series are OK, right? :>
@@ -304,7 +306,7 @@ EOF
 	close $fh or die "close git/config: $!";
 
 	open $fh, '>', "$git_dir/HEAD" or die "open git/HEAD: $!";
-	print $fh "ref: refs/heads/master\n" or die "print git/HEAD: $!";
+	print $fh "ref: $default_branch\n" or die "print git/HEAD: $!";
 	close $fh or die "close git/HEAD: $!";
 
 	my $f = 'objects/info/alternates';

base-commit: e7d9df936d071b4a9b72d2e6096ddf1e90c1bc05
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-27  4:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26 22:13 [PATCH] solver_git: support non-master git default branch Thomas Weißschuh
2021-10-27  4:20 ` Eric Wong
2021-10-27  4:59   ` Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).