1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 17:14:27 +00:00

fix bare repo issue

This commit is contained in:
Unknwon 2015-08-28 19:34:23 +08:00
parent 125d314465
commit a541ca16b6

View File

@ -615,8 +615,6 @@ func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts C
if err = initRepoCommit(tmpDir, u.NewGitSig()); err != nil { if err = initRepoCommit(tmpDir, u.NewGitSig()); err != nil {
return fmt.Errorf("initRepoCommit: %v", err) return fmt.Errorf("initRepoCommit: %v", err)
} }
} else {
repo.IsBare = true
} }
// Re-fetch the repository from database before updating it (else it would // Re-fetch the repository from database before updating it (else it would
@ -625,6 +623,10 @@ func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts C
return fmt.Errorf("getRepositoryByID: %v", err) return fmt.Errorf("getRepositoryByID: %v", err)
} }
if !opts.AutoInit {
repo.IsBare = true
}
repo.DefaultBranch = "master" repo.DefaultBranch = "master"
if err = updateRepository(e, repo, false); err != nil { if err = updateRepository(e, repo, false); err != nil {
return fmt.Errorf("updateRepository: %v", err) return fmt.Errorf("updateRepository: %v", err)