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
f7ceef06
Commit
f7ceef06
authored
May 24, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1592 from ethomson/merge_setup
merge setup
parents
4811c150
9c06b250
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 @
f7ceef06
...
@@ -23,13 +23,13 @@
...
@@ -23,13 +23,13 @@
GIT_BEGIN_DECL
GIT_BEGIN_DECL
/**
/**
* Flags for
tree_many diff
options. A combination of these flags can be
* Flags for
`git_mrege_tree`
options. A combination of these flags can be
* passed in via the `flags` v
alue in the `git_diff_tree_many_option
s`.
* passed in via the `flags` v
laue in the `git_merge_tree_opt
s`.
*/
*/
typedef
enum
{
typedef
enum
{
/** Detect renames */
/** Detect renames */
GIT_MERGE_TREE_FIND_RENAMES
=
(
1
<<
0
),
GIT_MERGE_TREE_FIND_RENAMES
=
(
1
<<
0
),
}
git_merge_tree_flag
s
;
}
git_merge_tree_flag
_t
;
/**
/**
* Automerge options for `git_merge_trees_opts`.
* Automerge options for `git_merge_trees_opts`.
...
@@ -44,7 +44,7 @@ typedef enum {
...
@@ -44,7 +44,7 @@ typedef enum {
typedef
struct
{
typedef
struct
{
unsigned
int
version
;
unsigned
int
version
;
git_merge_tree_flag
s
flags
;
git_merge_tree_flag
_t
flags
;
/** Similarity to consider a file renamed (default 50) */
/** Similarity to consider a file renamed (default 50) */
unsigned
int
rename_threshold
;
unsigned
int
rename_threshold
;
...
@@ -96,6 +96,57 @@ GIT_EXTERN(int) git_merge_base_many(
...
@@ -96,6 +96,57 @@ GIT_EXTERN(int) git_merge_base_many(
size_t
length
);
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
* Merge two trees, producing a `git_index` that reflects the result of
* the merge.
* the merge.
*
*
...
...
include/git2/types.h
View file @
f7ceef06
...
@@ -168,6 +168,9 @@ typedef struct git_reference git_reference;
...
@@ -168,6 +168,9 @@ typedef struct git_reference git_reference;
/** Iterator for references */
/** Iterator for references */
typedef
struct
git_reference_iterator
git_reference_iterator
;
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. */
/** Basic type of any Git reference. */
typedef
enum
{
typedef
enum
{
...
...
src/merge.c
View file @
f7ceef06
This diff is collapsed.
Click to expand it.
src/merge.h
View file @
f7ceef06
...
@@ -107,12 +107,25 @@ typedef struct {
...
@@ -107,12 +107,25 @@ typedef struct {
git_delta_t
their_status
;
git_delta_t
their_status
;
}
git_merge_diff
;
}
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
(
int
git_merge__bases_many
(
git_commit_list
**
out
,
git_commit_list
**
out
,
git_revwalk
*
walk
,
git_revwalk
*
walk
,
git_commit_list_node
*
one
,
git_commit_list_node
*
one
,
git_vector
*
twos
);
git_vector
*
twos
);
/*
* Three-way tree differencing
*/
git_merge_diff_list
*
git_merge_diff_list__alloc
(
git_repository
*
repo
);
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
,
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
...
@@ -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
);
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
#endif
tests-clar/merge/workdir/setup.c
View file @
f7ceef06
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