List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] use main as default branch instead of master
@ 2022-01-09  1:45 Derek Stevens
  2022-01-09  3:04 ` Reto
  0 siblings, 1 reply; 4+ messages in thread
From: Derek Stevens @ 2022-01-09  1:45 UTC (permalink / raw)
  To: cgit; +Cc: Derek Stevens

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


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

end of thread, other threads:[~2022-01-09 17:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-09  1:45 [PATCH] use main as default branch instead of master Derek Stevens
2022-01-09  3:04 ` Reto
2022-01-09 12:53   ` Jan Drögehoff
2022-01-09 17:22     ` Derek Stevens

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).