Huge updates!!!!! Be careful to merge!!!!
This commit is contained in:
parent
3f38ff6c09
commit
5c4bc3c848
43 changed files with 2225 additions and 2125 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue