Browse Source

more clear error

tags/v1.2.0-rc1
Unknwon 9 years ago
parent
commit
c6e957c846
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      modules/git/repo_branch.go

+ 1
- 2
modules/git/repo_branch.go View File

@@ -5,7 +5,6 @@
package git package git


import ( import (
"errors"
"strings" "strings"


"github.com/Unknwon/com" "github.com/Unknwon/com"
@@ -23,7 +22,7 @@ func (repo *Repository) IsBranchExist(branchName string) bool {
func (repo *Repository) GetBranches() ([]string, error) { func (repo *Repository) GetBranches() ([]string, error) {
stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "show-ref", "--heads") stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "show-ref", "--heads")
if err != nil { if err != nil {
return nil, errors.New(stderr)
return nil, concatenateError(err, stderr)
} }
infos := strings.Split(stdout, "\n") infos := strings.Split(stdout, "\n")
branches := make([]string, len(infos)-1) branches := make([]string, len(infos)-1)


Loading…
Cancel
Save