diff --git a/tree_entry.go b/tree_entry.go index 0fe11b9..12f5620 100644 --- a/tree_entry.go +++ b/tree_entry.go @@ -110,6 +110,7 @@ func (tes Entries) Sort() { type commitInfo struct { id string + entry string infos []interface{} err error } @@ -128,7 +129,7 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string) ([][]interfac for i := range tes { if tes[i].Type != OBJECT_COMMIT { go func(i int) { - cinfo := commitInfo{id: tes[i].ID.String()} + cinfo := commitInfo{id: tes[i].ID.String(), entry: tes[i].Name()} c, err := commit.GetCommitByPath(filepath.Join(treePath, tes[i].Name())) if err != nil { cinfo.err = fmt.Errorf("GetCommitByPath (%s/%s): %v", treePath, tes[i].Name(), err) @@ -142,7 +143,7 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string) ([][]interfac // Handle submodule go func(i int) { - cinfo := commitInfo{id: tes[i].ID.String()} + cinfo := commitInfo{id: tes[i].ID.String(), entry: tes[i].Name()} sm, err := commit.GetSubModule(path.Join(treePath, tes[i].Name())) if err != nil { cinfo.err = fmt.Errorf("GetSubModule (%s/%s): %v", treePath, tes[i].Name(), err) @@ -171,7 +172,7 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string) ([][]interfac return nil, info.err } - infoMap[info.id] = info.infos + infoMap[info.entry] = info.infos i++ if i == len(tes) { break @@ -180,7 +181,7 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string) ([][]interfac commitsInfo := make([][]interface{}, len(tes)) for i := 0; i < len(tes); i++ { - commitsInfo[i] = infoMap[tes[i].ID.String()] + commitsInfo[i] = infoMap[tes[i].Name()] } return commitsInfo, nil }