summary refs log tree commit diff stats
path: root/overlays/cgit-pink/set-default-branch-main.patch
blob: 0e91525e8f7fcb1cacd588c400aa0b6016910344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/cgit.c b/cgit.c
index dd28a79..451f518 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/ui-repolist.c b/ui-repolist.c
index 97b11c5..cde9cd0 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;