Browse Source

Return errors instead of just logging them.

tags/v0.9.99
Josh Frye 8 years ago
parent
commit
7f2733fa1b
1 changed files with 2 additions and 4 deletions
  1. 2
    4
      models/repo.go

+ 2
- 4
models/repo.go View File

// Try to get HEAD branch and set it as default branch. // Try to get HEAD branch and set it as default branch.
gitRepo, err := git.OpenRepository(repoPath) gitRepo, err := git.OpenRepository(repoPath)
if err != nil { if err != nil {
log.Error(4, "OpenRepository: %v", err)
return repo, nil
return repo, fmt.Errorf("OpenRepository: %v", err)
} }
headBranch, err := gitRepo.GetHEADBranch() headBranch, err := gitRepo.GetHEADBranch()
if err != nil { if err != nil {
log.Error(4, "GetHEADBranch: %v", err)
return repo, nil
return repo, fmt.Errorf("GetHEADBranch: %v", err)
} }
if headBranch != nil { if headBranch != nil {
repo.DefaultBranch = headBranch.Name repo.DefaultBranch = headBranch.Name

Loading…
Cancel
Save