summaryrefslogtreecommitdiff
path: root/src/merge.h
blob: af1dabd8efefe791ea729760015872f316dc750b (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (C) 2009-2012 the libgit2 contributors
 *
 * 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_merge_h__
#define INCLUDE_merge_h__

#include "vector.h"
#include "commit_list.h"
#include "diff_tree.h"

#include "git2/types.h"
#include "git2/diff_tree.h"

#define GIT_MERGE_MSG_FILE		"MERGE_MSG"
#define GIT_MERGE_MODE_FILE		"MERGE_MODE"

#define MERGE_CONFIG_FILE_MODE	0666

/** Internal structure for merge inputs */
struct git_merge_head {
	char *branch_name;
	git_oid oid;

	git_commit *commit;
};

/** Internal structure for merge results */
struct git_merge_result {
	bool is_uptodate;

	bool is_fastforward;
	git_oid fastforward_oid;
	
	git_diff_tree_list *diff_tree;
	git_vector conflicts;
};

int git_merge__setup(
	git_repository *repo,
	const git_merge_head *our_head,
	const git_merge_head *their_heads[],
	size_t their_heads_len,
	unsigned int flags);
int git_merge__bases_many(git_commit_list **out, git_revwalk *walk, git_commit_list_node *one, git_vector *twos);
int git_merge__cleanup(git_repository *repo);

#endif