Beispiel #1
0
func resolveCommitParent(commit *git.Commit) result.Result {
	parent := commit.Parent(0)
	if parent == nil {
		return result.NewFailure(errors.New(noParentError))
	}
	return result.NewSuccess(parent)
}
Beispiel #2
0
// 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)
	})
}
Beispiel #3
0
func commitTree(commit *git.Commit) result.Result {
	return result.NewResult(commit.Tree())
}