mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Huge updates!!!!! Be careful to merge!!!!
This commit is contained in:
		@@ -5,12 +5,33 @@
 | 
			
		||||
package git
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"container/list"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const prettyLogFormat = `--pretty=format:%H`
 | 
			
		||||
 | 
			
		||||
func parsePrettyFormatLog(repo *Repository, logByts []byte) (*list.List, error) {
 | 
			
		||||
	l := list.New()
 | 
			
		||||
	if len(logByts) == 0 {
 | 
			
		||||
		return l, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	parts := bytes.Split(logByts, []byte{'\n'})
 | 
			
		||||
 | 
			
		||||
	for _, commitId := range parts {
 | 
			
		||||
		commit, err := repo.GetCommit(string(commitId))
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
		l.PushBack(commit)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return l, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func RefEndName(refStr string) string {
 | 
			
		||||
	index := strings.LastIndex(refStr, "/")
 | 
			
		||||
	if index != -1 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user