Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
9c06b250
Commit
9c06b250
authored
May 16, 2013
by
Edward Thomson
Committed by
Edward Thomson
May 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge setup
parent
5b3d52ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
4 deletions
+80
-4
include/git2/merge.h
+55
-4
include/git2/types.h
+3
-0
src/merge.c
+0
-0
src/merge.h
+22
-0
tests-clar/merge/workdir/setup.c
+0
-0
No files found.
include/git2/merge.h
View file @
9c06b250
...
...
@@ -23,13 +23,13 @@
GIT_BEGIN_DECL
/**
* Flags for
tree_many diff
options. A combination of these flags can be
* passed in via the `flags` v
alue in the `git_diff_tree_many_option
s`.
* Flags for
`git_mrege_tree`
options. A combination of these flags can be
* passed in via the `flags` v
laue in the `git_merge_tree_opt
s`.
*/
typedef
enum
{
/** Detect renames */
GIT_MERGE_TREE_FIND_RENAMES
=
(
1
<<
0
),
}
git_merge_tree_flag
s
;
}
git_merge_tree_flag
_t
;
/**
* Automerge options for `git_merge_trees_opts`.
...
...
@@ -44,7 +44,7 @@ typedef enum {
typedef
struct
{
unsigned
int
version
;
git_merge_tree_flag
s
flags
;
git_merge_tree_flag
_t
flags
;
/** Similarity to consider a file renamed (default 50) */
unsigned
int
rename_threshold
;
...
...
@@ -96,6 +96,57 @@ GIT_EXTERN(int) git_merge_base_many(
size_t
length
);
/**
* Creates a `git_merge_head` from the given reference
*
* @param out pointer to store the git_merge_head result in
* @param repo repository that contains the given reference
* @param ref reference to use as a merge input
* @return zero on success, -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_head_from_ref
(
git_merge_head
**
out
,
git_repository
*
repo
,
git_reference
*
ref
);
/**
* Creates a `git_merge_head` from the given fetch head data
*
* @param out pointer to store the git_merge_head result in
* @param repo repository that contains the given commit
* @param branch_name name of the (remote) branch
* @param remote_url url of the remote
* @param oid the commit object id to use as a merge input
* @return zero on success, -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_head_from_fetchhead
(
git_merge_head
**
out
,
git_repository
*
repo
,
const
char
*
branch_name
,
const
char
*
remote_url
,
const
git_oid
*
oid
);
/**
* Creates a `git_merge_head` from the given commit id
*
* @param out pointer to store the git_merge_head result in
* @param repo repository that contains the given commit
* @param oid the commit object id to use as a merge input
* @return zero on success, -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_head_from_oid
(
git_merge_head
**
out
,
git_repository
*
repo
,
const
git_oid
*
oid
);
/**
* Frees a `git_merge_head`
*
* @param the merge head to free
*/
GIT_EXTERN
(
void
)
git_merge_head_free
(
git_merge_head
*
head
);
/**
* Merge two trees, producing a `git_index` that reflects the result of
* the merge.
*
...
...
include/git2/types.h
View file @
9c06b250
...
...
@@ -168,6 +168,9 @@ typedef struct git_reference git_reference;
/** Iterator for references */
typedef
struct
git_reference_iterator
git_reference_iterator
;
/** Merge heads, the input to merge */
typedef
struct
git_merge_head
git_merge_head
;
/** Basic type of any Git reference. */
typedef
enum
{
...
...
src/merge.c
View file @
9c06b250
This diff is collapsed.
Click to expand it.
src/merge.h
View file @
9c06b250
...
...
@@ -107,12 +107,25 @@ typedef struct {
git_delta_t
their_status
;
}
git_merge_diff
;
/** Internal structure for merge inputs */
struct
git_merge_head
{
char
*
ref_name
;
char
*
remote_url
;
git_oid
oid
;
git_commit
*
commit
;
};
int
git_merge__bases_many
(
git_commit_list
**
out
,
git_revwalk
*
walk
,
git_commit_list_node
*
one
,
git_vector
*
twos
);
/*
* Three-way tree differencing
*/
git_merge_diff_list
*
git_merge_diff_list__alloc
(
git_repository
*
repo
);
int
git_merge_diff_list__find_differences
(
git_merge_diff_list
*
merge_diff_list
,
...
...
@@ -124,4 +137,13 @@ int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list
void
git_merge_diff_list__free
(
git_merge_diff_list
*
diff_list
);
/* Merge metadata setup */
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
);
#endif
tests-clar/merge/workdir/setup.c
View file @
9c06b250
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment