Blame src/annotated_commit.h

Packit Service 20376f
/*
Packit Service 20376f
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit Service 20376f
 *
Packit Service 20376f
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit Service 20376f
 * a Linking Exception. For full terms see the included COPYING file.
Packit Service 20376f
 */
Packit Service 20376f
#ifndef INCLUDE_annotated_commit_h__
Packit Service 20376f
#define INCLUDE_annotated_commit_h__
Packit Service 20376f
Packit Service 20376f
#include "oidarray.h"
Packit Service 20376f
Packit Service 20376f
#include "git2/oid.h"
Packit Service 20376f
Packit Service 20376f
typedef enum {
Packit Service 20376f
	GIT_ANNOTATED_COMMIT_REAL = 1,
Packit Service 20376f
	GIT_ANNOTATED_COMMIT_VIRTUAL = 2,
Packit Service 20376f
} git_annotated_commit_t;
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Internal structure for merge inputs.  An annotated commit is generally
Packit Service 20376f
 * "real" and backed by an actual commit in the repository, but merge will
Packit Service 20376f
 * internally create "virtual" commits that are in-memory intermediate
Packit Service 20376f
 * commits backed by an index.
Packit Service 20376f
 */
Packit Service 20376f
struct git_annotated_commit {
Packit Service 20376f
	git_annotated_commit_t type;
Packit Service 20376f
Packit Service 20376f
	/* real commit */
Packit Service 20376f
	git_commit *commit;
Packit Service 20376f
	git_tree *tree;
Packit Service 20376f
Packit Service 20376f
	/* virtual commit structure */
Packit Service 20376f
	git_index *index;
Packit Service 20376f
	git_array_oid_t parents;
Packit Service 20376f
Packit Service 20376f
	/* how this commit was looked up */
Packit Service 20376f
	const char *description;
Packit Service 20376f
Packit Service 20376f
	const char *ref_name;
Packit Service 20376f
	const char *remote_url;
Packit Service 20376f
Packit Service 20376f
	char id_str[GIT_OID_HEXSZ+1];
Packit Service 20376f
};
Packit Service 20376f
Packit Service 20376f
extern int git_annotated_commit_from_head(git_annotated_commit **out,
Packit Service 20376f
	git_repository *repo);
Packit Service 20376f
extern int git_annotated_commit_from_commit(git_annotated_commit **out,
Packit Service 20376f
	git_commit *commit);
Packit Service 20376f
Packit Service 20376f
#endif