We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a957d4e commit 4d643a5Copy full SHA for 4d643a5
models/action.go
@@ -685,6 +685,17 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
685
if repo.IsEmpty && opts.NewCommitID != git.EmptySHA && strings.HasPrefix(opts.RefFullName, git.BranchPrefix) {
686
repo.DefaultBranch = refName
687
repo.IsEmpty = false
688
+ if refName != "master" {
689
+ gitRepo, err := git.OpenRepository(repo.RepoPath())
690
+ if err != nil {
691
+ return err
692
+ }
693
+ if err := gitRepo.SetDefaultBranch(repo.DefaultBranch); err != nil {
694
+ if !git.IsErrUnsupportedVersion(err) {
695
696
697
698
699
}
700
701
// Change repository empty status and update last updated time.
0 commit comments