Skip to content

Commit 6d89d0d

Browse files
committed
rename default branch from 'master' to 'main' in refs and test scripts
Signed-off-by: Wing Huang <[email protected]> modified: refs.c modified: remote.c modified: t/test-lib.sh
1 parent 1fa6894 commit 6d89d0d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ char *repo_default_branch_name(struct repository *r, int quiet)
653653
die(_("could not retrieve `%s`"), config_display_key);
654654

655655
if (!ret) {
656-
ret = xstrdup("master");
656+
ret = xstrdup("main");
657657
if (!quiet)
658658
advise_if_enabled(ADVICE_DEFAULT_BRANCH_NAME,
659659
_(default_branch_name_advice), ret);

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2379,7 +2379,7 @@ struct ref *guess_remote_head(const struct ref *head,
23792379
return copy_ref(r);
23802380

23812381
/* Fall back to the hard-coded historical default */
2382-
r = find_ref_by_name(refs, "refs/heads/master");
2382+
r = find_ref_by_name(refs, "refs/heads/main");
23832383
if (r && oideq(&r->old_oid, &head->old_oid))
23842384
return copy_ref(r);
23852385
}

t/test-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fi
129129

130130
# Explicitly set the default branch name for testing, to avoid the
131131
# transitory "git init" warning under --verbose.
132-
: ${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME:=master}
132+
: ${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME:=main}
133133
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
134134

135135
################################################################

0 commit comments

Comments
 (0)