mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	@@ -27,7 +27,7 @@ func (repo *Repository) GetTags() ([]string, error) {
 | 
			
		||||
	}
 | 
			
		||||
	stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, errors.New(stderr)
 | 
			
		||||
		return nil, concatenateError(err, stderr)
 | 
			
		||||
	}
 | 
			
		||||
	tags := strings.Split(stdout, "\n")
 | 
			
		||||
	return tags[:len(tags)-1], nil
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@ package git
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"container/list"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
@@ -67,3 +68,10 @@ func isFile(filePath string) bool {
 | 
			
		||||
	}
 | 
			
		||||
	return !f.IsDir()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func concatenateError(err error, stderr string) error {
 | 
			
		||||
	if len(stderr) == 0 {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return fmt.Errorf("%v: %s", err, stderr)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user