From b58812136e404434ac01612cb4a573881f45eb55 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 19 Aug 2018 13:58:55 +0200 Subject: bug: remove use of the too recent %(refname:lstrip=-1) of git fix #24 --- repository/git.go | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'repository/git.go') diff --git a/repository/git.go b/repository/git.go index d55def9e..5b5cbc3d 100644 --- a/repository/git.go +++ b/repository/git.go @@ -257,25 +257,6 @@ func (repo *GitRepo) ListRefs(refspec string) ([]string, error) { return splitted, nil } -// ListIds will return a list of Git ref matching the given refspec, -// stripped to only the last part of the ref -func (repo *GitRepo) ListIds(refspec string) ([]string, error) { - // the format option will strip the ref name to keep only the last part (ie, the bug id) - stdout, err := repo.runGitCommand("for-each-ref", "--format=%(refname:lstrip=-1)", refspec) - - if err != nil { - return nil, err - } - - splitted := strings.Split(stdout, "\n") - - if len(splitted) == 1 && splitted[0] == "" { - return []string{}, nil - } - - return splitted, nil -} - // RefExist will check if a reference exist in Git func (repo *GitRepo) RefExist(ref string) (bool, error) { stdout, err := repo.runGitCommand("for-each-ref", ref) -- cgit