summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJosh Frye <joshfng@gmail.com>2016-03-03 12:43:23 -0500
committerJosh Frye <joshfng@gmail.com>2016-03-03 12:43:23 -0500
commit7f2733fa1b412593f676cd04a1c9166b51e56640 (patch)
treec1765c0afbeade76bad6c8dc805116bb2cc8ca03 /models
parentedb7967dc7c1910f54b44e5ea92fea8044d74b9b (diff)
downloadgitea-7f2733fa1b412593f676cd04a1c9166b51e56640.tar.gz
gitea-7f2733fa1b412593f676cd04a1c9166b51e56640.zip
Return errors instead of just logging them.
Diffstat (limited to 'models')
-rw-r--r--models/repo.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/models/repo.go b/models/repo.go
index 30abc5d430..22336d3c1a 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -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