summaryrefslogtreecommitdiff
path: root/src/libgit2/grafts.h
blob: fc61468f57659f19444af9762f6504ce2f8211eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_graft_h__
#define INCLUDE_graft_h__

#include "common.h"
#include "oidarray.h"
#include "oidmap.h"

/** graft commit */
typedef struct {
	git_oid oid;
	git_array_oid_t parents;
} git_commit_graft;

typedef struct git_grafts git_grafts;

int git_grafts_new(git_grafts **out);
int git_grafts_from_file(git_grafts **out, const char *path);
void git_grafts_free(git_grafts *grafts);
void git_grafts_clear(git_grafts *grafts);

int git_grafts_refresh(git_grafts *grafts);
int git_grafts_parse(git_grafts *grafts, const char *content, size_t contentlen);
int git_grafts_add(git_grafts *grafts, const git_oid *oid, git_array_oid_t parents);
int git_grafts_remove(git_grafts *grafts, const git_oid *oid);
int git_grafts_get(git_commit_graft **out, git_grafts *grafts, const git_oid *oid);
int git_grafts_get_oids(git_array_oid_t *out, git_grafts *grafts);
size_t git_grafts_size(git_grafts *grafts);

#endif