func resolveCommitParent(commit *git.Commit) result.Result { parent := commit.Parent(0) if parent == nil { return result.NewFailure(errors.New(noParentError)) } return result.NewSuccess(parent) }
// Finds all comments on a commit // @return result.Result<[]*Comment, error> func commentsOnCommit(repo *git.Repository, commit *git.Commit) result.Result { var comments []interface{} return gg.CommitCommentRefIterator(repo, commit.Id().String(), func(ref *git.Reference) { CommentFromRef(repo, ref.Name()).FlatMap(func(comment interface{}) result.Result { comments = append(comments, comment) return result.Result{} }) }).FlatMap(func(value interface{}) result.Result { return result.NewSuccess(comments) }) }
func commitTree(commit *git.Commit) result.Result { return result.NewResult(commit.Tree()) }