1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

Return errors instead of just logging them.

This commit is contained in:
Josh Frye 2016-03-03 12:43:23 -05:00
parent edb7967dc7
commit 7f2733fa1b

View file

@ -676,13 +676,11 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
// Try to get HEAD branch and set it as default branch.
gitRepo, err := git.OpenRepository(repoPath)
if err != nil {
log.Error(4, "OpenRepository: %v", err)
return repo, nil
return repo, fmt.Errorf("OpenRepository: %v", err)
}
headBranch, err := gitRepo.GetHEADBranch()
if err != nil {
log.Error(4, "GetHEADBranch: %v", err)
return repo, nil
return repo, fmt.Errorf("GetHEADBranch: %v", err)
}
if headBranch != nil {
repo.DefaultBranch = headBranch.Name