Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Repository: Improved GetForEachRef
Browse files Browse the repository at this point in the history
Removed unnecessary replace
  • Loading branch information
marcelometal committed Jul 23, 2014
1 parent 4a9780f commit 3f0a0a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (*GitContentRetriever) GetForEachRef(repo, pattern string) ([]map[string]st
if err != nil || !repoExists {
return nil, fmt.Errorf("Error when trying to obtain the branches of repository %s (Repository does not exist).", repo)
}
cmd := exec.Command(gitPath, "for-each-ref", "--sort=-committerdate", "--format", "%(objectname)%09%(refname)%09%(committername)%09%(committeremail)%09%(committerdate)%09%(authorname)%09%(authoremail)%09%(authordate)%09%(contents:subject)", pattern)
cmd := exec.Command(gitPath, "for-each-ref", "--sort=-committerdate", "--format", "%(objectname)%09%(refname:short)%09%(committername)%09%(committeremail)%09%(committerdate)%09%(authorname)%09%(authoremail)%09%(authordate)%09%(contents:subject)", pattern)
cmd.Dir = cwd
out, err := cmd.Output()
if err != nil {
Expand All @@ -379,7 +379,7 @@ func (*GitContentRetriever) GetForEachRef(repo, pattern string) ([]map[string]st
fields := strings.Split(line, "\t")
if len(fields) > 4 { // let there be commits with empty subject
ref = fields[0]
name = strings.Replace(fields[1], pattern, "", 1)
name = fields[1]
commiterName = fields[2]
commiterEmail = fields[3]
commiterDate = fields[4]
Expand Down

0 comments on commit 3f0a0a3

Please sign in to comment.