Exemple #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)
}
Exemple #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)
	})
}
Exemple #3
0
func commitTree(commit *git.Commit) result.Result {
	return result.NewResult(commit.Tree())
}