Blame include/git2/graph.h

Packit ae9e2a
/*
Packit ae9e2a
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit ae9e2a
 *
Packit ae9e2a
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit ae9e2a
 * a Linking Exception. For full terms see the included COPYING file.
Packit ae9e2a
 */
Packit ae9e2a
#ifndef INCLUDE_git_graph_h__
Packit ae9e2a
#define INCLUDE_git_graph_h__
Packit ae9e2a
Packit ae9e2a
#include "common.h"
Packit ae9e2a
#include "types.h"
Packit ae9e2a
#include "oid.h"
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * @file git2/graph.h
Packit ae9e2a
 * @brief Git graph traversal routines
Packit ae9e2a
 * @defgroup git_revwalk Git graph traversal routines
Packit ae9e2a
 * @ingroup Git
Packit ae9e2a
 * @{
Packit ae9e2a
 */
Packit ae9e2a
GIT_BEGIN_DECL
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Count the number of unique commits between two commit objects
Packit ae9e2a
 *
Packit ae9e2a
 * There is no need for branches containing the commits to have any
Packit ae9e2a
 * upstream relationship, but it helps to think of one as a branch and
Packit ae9e2a
 * the other as its upstream, the `ahead` and `behind` values will be
Packit ae9e2a
 * what git would report for the branches.
Packit ae9e2a
 *
Packit ae9e2a
 * @param ahead number of unique from commits in `upstream`
Packit ae9e2a
 * @param behind number of unique from commits in `local`
Packit ae9e2a
 * @param repo the repository where the commits exist
Packit ae9e2a
 * @param local the commit for local
Packit ae9e2a
 * @param upstream the commit for upstream
Packit ae9e2a
 */
Packit ae9e2a
GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream);
Packit ae9e2a
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Determine if a commit is the descendant of another commit.
Packit ae9e2a
 *
Packit ae9e2a
 * @param commit a previously loaded commit.
Packit ae9e2a
 * @param ancestor a potential ancestor commit.
Packit ae9e2a
 * @return 1 if the given commit is a descendant of the potential ancestor,
Packit ae9e2a
 * 0 if not, error code otherwise.
Packit ae9e2a
 */
Packit ae9e2a
GIT_EXTERN(int) git_graph_descendant_of(
Packit ae9e2a
	git_repository *repo,
Packit ae9e2a
	const git_oid *commit,
Packit ae9e2a
	const git_oid *ancestor);
Packit ae9e2a
Packit ae9e2a
/** @} */
Packit ae9e2a
GIT_END_DECL
Packit ae9e2a
#endif