Browse Source

fix bare repo issue

tags/v0.9.99
Unknwon 8 years ago
parent
commit
a541ca16b6
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      models/repo.go

+ 4
- 2
models/repo.go 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 {
return fmt.Errorf("initRepoCommit: %v", err)
}
} else {
repo.IsBare = true
}

// 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)
}

if !opts.AutoInit {
repo.IsBare = true
}

repo.DefaultBranch = "master"
if err = updateRepository(e, repo, false); err != nil {
return fmt.Errorf("updateRepository: %v", err)

Loading…
Cancel
Save