Exemplo n.º 1
0
int git_revwalk_next(git_oid *oid, git_revwalk *walk)
{
	int error;
	git_commit_list_node *next;

	assert(walk && oid);

	if (!walk->walking) {
		if ((error = prepare_walk(walk)) < 0)
			return error;
	}

	error = walk->get_next(&next, walk);

	if (error == GIT_ITEROVER) {
		git_revwalk_reset(walk);
		giterr_clear();
		return GIT_ITEROVER;
	}

	if (!error)
		git_oid_cpy(oid, &next->oid);

	return error;
}
Exemplo n.º 2
0
int git_revwalk_next(git_commit **commit, git_revwalk *walk)
{
	git_revwalk_commit *next;

	assert(walk && commit);

	if (!walk->walking)
		prepare_walk(walk);

	*commit = NULL;

	while ((next = walk->next(&walk->iterator)) != NULL) {
		if (!next->uninteresting) {
			*commit = next->commit_object;
			GIT_OBJECT_INCREF(*commit);
			return GIT_SUCCESS;
		}
	}

	/* No commits left to iterate */
	git_revwalk_reset(walk);
	return GIT_EREVWALKOVER;
}