List for cgit developers and users
 help / color / mirror / Atom feed
From: Derek Stevens <nilix@nilfm.cc>
To: cgit@lists.zx2c4.com
Cc: Derek Stevens <nilix@nilfm.cc>
Subject: [PATCH] use main as default branch instead of master
Date: Sat,  8 Jan 2022 18:45:45 -0700	[thread overview]
Message-ID: <20220109014545.17815-1-nilix@nilfm.cc> (raw)

Signed-off-by: Derek Stevens <nilix@nilfm.cc>
---
 cgit.c        | 2 +-
 cgitrc.5.txt  | 2 +-
 ui-repolist.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cgit.c b/cgit.c
index 08d81a1..5b0a016 100644
--- a/cgit.c
+++ b/cgit.c
@@ -489,7 +489,7 @@ static char *guess_defbranch(void)
 
 	ref = resolve_ref_unsafe("HEAD", 0, &oid, NULL);
 	if (!ref || !skip_prefix(ref, "refs/heads/", &refname))
-		return "master";
+		return "main";
 	return xstrdup(refname);
 }
 
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 33a6a8c..9639156 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -479,7 +479,7 @@ repo.defbranch::
 	The name of the default branch for this repository. If no such branch
 	exists in the repository, the first branch name (when sorted) is used
 	as default instead. Default value: branch pointed to by HEAD, or
-	"master" if there is no suitable HEAD.
+	"main" if there is no suitable HEAD.
 
 repo.desc::
 	The value to show as repository description. Default value: none.
diff --git a/ui-repolist.c b/ui-repolist.c
index 529a203..c162290 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -53,7 +53,7 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime)
 
 	strbuf_reset(&path);
 	strbuf_addf(&path, "%s/refs/heads/%s", repo->path,
-		    repo->defbranch ? repo->defbranch : "master");
+		    repo->defbranch ? repo->defbranch : "main");
 	if (stat(path.buf, &s) == 0) {
 		*mtime = s.st_mtime;
 		r->mtime = *mtime;
-- 
2.34.1


             reply	other threads:[~2022-01-09  1:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09  1:45 Derek Stevens [this message]
2022-01-09  3:04 ` Reto
2022-01-09 12:53   ` Jan Drögehoff
2022-01-09 17:22     ` Derek Stevens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220109014545.17815-1-nilix@nilfm.cc \
    --to=nilix@nilfm.cc \
    --cc=cgit@lists.zx2c4.com \
    --subject='Re: [PATCH] use main as default branch instead of master' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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 NNTP newsgroup(s).