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
5aa2ac6d
Commit
5aa2ac6d
authored
Mar 11, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update git_merge_tree_opts to git_merge_options
parent
02105a27
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
75 additions
and
75 deletions
+75
-75
include/git2/merge.h
+13
-13
include/git2/revert.h
+3
-3
src/merge.c
+24
-24
src/merge.h
+1
-1
src/revert.c
+3
-3
tests/merge/merge_helpers.c
+3
-3
tests/merge/merge_helpers.h
+3
-3
tests/merge/trees/automerge.c
+4
-4
tests/merge/trees/commits.c
+3
-3
tests/merge/trees/renames.c
+2
-2
tests/merge/trees/treediff.c
+1
-1
tests/merge/trees/trivial.c
+1
-1
tests/merge/workdir/dirty.c
+1
-1
tests/merge/workdir/renames.c
+3
-3
tests/merge/workdir/simple.c
+4
-4
tests/revert/workdir.c
+4
-4
tests/structinit/structinit.c
+2
-2
No files found.
include/git2/merge.h
View file @
5aa2ac6d
...
...
@@ -216,22 +216,22 @@ typedef struct {
/** Flags for handling conflicting content. */
git_merge_file_favor_t
file_favor
;
}
git_merge_
tree_opt
s
;
}
git_merge_
option
s
;
#define GIT_MERGE_
TREE_OPT
S_VERSION 1
#define GIT_MERGE_
TREE_OPTS_INIT {GIT_MERGE_TREE_OPT
S_VERSION}
#define GIT_MERGE_
OPTION
S_VERSION 1
#define GIT_MERGE_
OPTIONS_INIT {GIT_MERGE_OPTION
S_VERSION}
/**
* Initializes a `git_merge_
tree_opt
s` with default values. Equivalent to
* creating an instance with GIT_MERGE_
TREE_OPT
S_INIT.
* Initializes a `git_merge_
option
s` with default values. Equivalent to
* creating an instance with GIT_MERGE_
OPTION
S_INIT.
*
* @param opts the `git_merge_
tree_opt
s` instance to initialize.
* @param opts the `git_merge_
option
s` instance to initialize.
* @param version the version of the struct; you should pass
* `GIT_MERGE_
TREE_OPT
S_VERSION` here.
* `GIT_MERGE_
OPTION
S_VERSION` here.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_
tree_init_opt
s
(
git_merge_
tree_opts
*
opts
,
GIT_EXTERN
(
int
)
git_merge_
init_option
s
(
git_merge_
options
*
opts
,
int
version
);
/**
...
...
@@ -447,7 +447,7 @@ GIT_EXTERN(int) git_merge_trees(
const
git_tree
*
ancestor_tree
,
const
git_tree
*
our_tree
,
const
git_tree
*
their_tree
,
const
git_merge_
tree_opt
s
*
opts
);
const
git_merge_
option
s
*
opts
);
/**
* Merge two commits, producing a `git_index` that reflects the result of
...
...
@@ -469,7 +469,7 @@ GIT_EXTERN(int) git_merge_commits(
git_repository
*
repo
,
const
git_commit
*
our_commit
,
const
git_commit
*
their_commit
,
const
git_merge_
tree_opt
s
*
opts
);
const
git_merge_
option
s
*
opts
);
/**
* Merges the given commit(s) into HEAD and either returns immediately
...
...
@@ -496,7 +496,7 @@ GIT_EXTERN(int) git_merge_commits(
* @param repo the repository to merge
* @param merge_heads the heads to merge into
* @param merge_heads_len the number of heads to merge
* @param
checkout
_opts merge options
* @param
merge
_opts merge options
* @param checkout_opts checkout options
* @return 0 on success or error code
*/
...
...
@@ -505,7 +505,7 @@ GIT_EXTERN(int) git_merge(
git_repository
*
repo
,
const
git_merge_head
**
their_heads
,
size_t
their_heads_len
,
const
git_merge_
tree_opt
s
*
merge_opts
,
const
git_merge_
option
s
*
merge_opts
,
const
git_checkout_options
*
checkout_opts
);
/**
...
...
include/git2/revert.h
View file @
5aa2ac6d
...
...
@@ -26,12 +26,12 @@ typedef struct {
/** For merge commits, the "mainline" is treated as the parent. */
unsigned
int
mainline
;
git_merge_
tree_opts
merge_tre
e_opts
;
git_merge_
options
merg
e_opts
;
git_checkout_options
checkout_opts
;
}
git_revert_options
;
#define GIT_REVERT_OPTIONS_VERSION 1
#define GIT_REVERT_OPTIONS_INIT {GIT_REVERT_OPTIONS_VERSION, 0, GIT_MERGE_
TREE_OPT
S_INIT, GIT_CHECKOUT_OPTIONS_INIT}
#define GIT_REVERT_OPTIONS_INIT {GIT_REVERT_OPTIONS_VERSION, 0, GIT_MERGE_
OPTION
S_INIT, GIT_CHECKOUT_OPTIONS_INIT}
/**
* Initializes a `git_revert_options` with default values. Equivalent to
...
...
@@ -66,7 +66,7 @@ int git_revert_commit(
git_commit
*
revert_commit
,
git_commit
*
our_commit
,
unsigned
int
mainline
,
const
git_merge_
tree_opts
*
merge_tree_opt
s
);
const
git_merge_
options
*
merge_option
s
);
/**
* Reverts the given commit, producing changes in the working directory.
...
...
src/merge.c
View file @
5aa2ac6d
...
...
@@ -664,7 +664,7 @@ static int index_entry_similarity_exact(
git_index_entry
*
b
,
size_t
b_idx
,
void
**
cache
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
GIT_UNUSED
(
repo
);
GIT_UNUSED
(
a_idx
);
...
...
@@ -682,7 +682,7 @@ static int index_entry_similarity_calc(
void
**
out
,
git_repository
*
repo
,
git_index_entry
*
entry
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
git_blob
*
blob
;
git_diff_file
diff_file
=
{{{
0
}}};
...
...
@@ -722,7 +722,7 @@ static int index_entry_similarity_inexact(
git_index_entry
*
b
,
size_t
b_idx
,
void
**
cache
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
int
score
=
0
;
int
error
=
0
;
...
...
@@ -759,9 +759,9 @@ static int merge_diff_mark_similarity(
git_merge_diff_list
*
diff_list
,
struct
merge_diff_similarity
*
similarity_ours
,
struct
merge_diff_similarity
*
similarity_theirs
,
int
(
*
similarity_fn
)(
git_repository
*
,
git_index_entry
*
,
size_t
,
git_index_entry
*
,
size_t
,
void
**
,
const
git_merge_
tree_opt
s
*
),
int
(
*
similarity_fn
)(
git_repository
*
,
git_index_entry
*
,
size_t
,
git_index_entry
*
,
size_t
,
void
**
,
const
git_merge_
option
s
*
),
void
**
cache
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
size_t
i
,
j
;
git_merge_diff
*
conflict_src
,
*
conflict_tgt
;
...
...
@@ -862,7 +862,7 @@ static void merge_diff_mark_rename_conflict(
bool
theirs_renamed
,
size_t
theirs_source_idx
,
git_merge_diff
*
target
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
git_merge_diff
*
ours_source
=
NULL
,
*
theirs_source
=
NULL
;
...
...
@@ -932,7 +932,7 @@ static void merge_diff_list_coalesce_renames(
git_merge_diff_list
*
diff_list
,
struct
merge_diff_similarity
*
similarity_ours
,
struct
merge_diff_similarity
*
similarity_theirs
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
size_t
i
;
bool
ours_renamed
=
0
,
theirs_renamed
=
0
;
...
...
@@ -1022,7 +1022,7 @@ static void merge_diff_list_count_candidates(
int
git_merge_diff_list__find_renames
(
git_repository
*
repo
,
git_merge_diff_list
*
diff_list
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
struct
merge_diff_similarity
*
similarity_ours
,
*
similarity_theirs
;
void
**
cache
=
NULL
;
...
...
@@ -1450,10 +1450,10 @@ void git_merge_diff_list__free(git_merge_diff_list *diff_list)
git__free
(
diff_list
);
}
static
int
merge_
tree_
normalize_opts
(
static
int
merge_normalize_opts
(
git_repository
*
repo
,
git_merge_
tree_opt
s
*
opts
,
const
git_merge_
tree_opt
s
*
given
)
git_merge_
option
s
*
opts
,
const
git_merge_
option
s
*
given
)
{
git_config
*
cfg
=
NULL
;
int
error
=
0
;
...
...
@@ -1464,9 +1464,9 @@ static int merge_tree_normalize_opts(
return
error
;
if
(
given
!=
NULL
)
memcpy
(
opts
,
given
,
sizeof
(
git_merge_
tree_opt
s
));
memcpy
(
opts
,
given
,
sizeof
(
git_merge_
option
s
));
else
{
git_merge_
tree_opts
init
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
init
=
GIT_MERGE_OPTION
S_INIT
;
memcpy
(
opts
,
&
init
,
sizeof
(
init
));
opts
->
flags
=
GIT_MERGE_TREE_FIND_RENAMES
;
...
...
@@ -1634,10 +1634,10 @@ int git_merge_trees(
const
git_tree
*
ancestor_tree
,
const
git_tree
*
our_tree
,
const
git_tree
*
their_tree
,
const
git_merge_
tree_opt
s
*
given_opts
)
const
git_merge_
option
s
*
given_opts
)
{
git_merge_diff_list
*
diff_list
;
git_merge_
tree_opt
s
opts
;
git_merge_
option
s
opts
;
git_merge_diff
*
conflict
;
git_vector
changes
;
size_t
i
;
...
...
@@ -1647,9 +1647,9 @@ int git_merge_trees(
*
out
=
NULL
;
GITERR_CHECK_VERSION
(
given_opts
,
GIT_MERGE_
TREE_OPTS_VERSION
,
"git_merge_tree_opt
s"
);
GITERR_CHECK_VERSION
(
given_opts
,
GIT_MERGE_
OPTIONS_VERSION
,
"git_merge_option
s"
);
if
((
error
=
merge_
tree_
normalize_opts
(
repo
,
&
opts
,
given_opts
))
<
0
)
if
((
error
=
merge_normalize_opts
(
repo
,
&
opts
,
given_opts
))
<
0
)
return
error
;
diff_list
=
git_merge_diff_list__alloc
(
repo
);
...
...
@@ -1688,7 +1688,7 @@ int git_merge_commits(
git_repository
*
repo
,
const
git_commit
*
our_commit
,
const
git_commit
*
their_commit
,
const
git_merge_
tree_opt
s
*
opts
)
const
git_merge_
option
s
*
opts
)
{
git_oid
ancestor_oid
;
git_commit
*
ancestor_commit
=
NULL
;
...
...
@@ -2552,7 +2552,7 @@ int git_merge(
git_repository
*
repo
,
const
git_merge_head
**
their_heads
,
size_t
their_heads_len
,
const
git_merge_
tree_opt
s
*
merge_opts
,
const
git_merge_
option
s
*
merge_opts
,
const
git_checkout_options
*
given_checkout_opts
)
{
git_merge_result
*
result
;
...
...
@@ -2779,14 +2779,14 @@ void git_merge_head_free(git_merge_head *head)
git__free
(
head
);
}
int
git_merge_
tree_init_opts
(
git_merge_tree_opts
*
opts
,
int
version
)
int
git_merge_
init_options
(
git_merge_options
*
opts
,
int
version
)
{
if
(
version
!=
GIT_MERGE_
TREE_OPT
S_VERSION
)
{
giterr_set
(
GITERR_INVALID
,
"Invalid version %d for git_merge_
tree_opt
s"
,
version
);
if
(
version
!=
GIT_MERGE_
OPTION
S_VERSION
)
{
giterr_set
(
GITERR_INVALID
,
"Invalid version %d for git_merge_
option
s"
,
version
);
return
-
1
;
}
else
{
git_merge_
tree_opts
o
=
GIT_MERGE_TREE_OPT
S_INIT
;
memcpy
(
opts
,
&
o
,
sizeof
(
o
));
git_merge_
options
default_opts
=
GIT_MERGE_OPTION
S_INIT
;
memcpy
(
opts
,
&
default_opts
,
sizeof
(
git_merge_options
));
return
0
;
}
}
...
...
src/merge.h
View file @
5aa2ac6d
...
...
@@ -147,7 +147,7 @@ int git_merge_diff_list__find_differences(git_merge_diff_list *merge_diff_list,
const
git_tree
*
ours_tree
,
const
git_tree
*
theirs_tree
);
int
git_merge_diff_list__find_renames
(
git_repository
*
repo
,
git_merge_diff_list
*
merge_diff_list
,
const
git_merge_
tree_opt
s
*
opts
);
int
git_merge_diff_list__find_renames
(
git_repository
*
repo
,
git_merge_diff_list
*
merge_diff_list
,
const
git_merge_
option
s
*
opts
);
void
git_merge_diff_list__free
(
git_merge_diff_list
*
diff_list
);
...
...
src/revert.c
View file @
5aa2ac6d
...
...
@@ -121,7 +121,7 @@ int git_revert_commit(
git_commit
*
revert_commit
,
git_commit
*
our_commit
,
unsigned
int
mainline
,
const
git_merge_
tree_opts
*
merge_tre
e_opts
)
const
git_merge_
options
*
merg
e_opts
)
{
git_commit
*
parent_commit
=
NULL
;
git_tree
*
parent_tree
=
NULL
,
*
our_tree
=
NULL
,
*
revert_tree
=
NULL
;
...
...
@@ -152,7 +152,7 @@ int git_revert_commit(
(
error
=
git_commit_tree
(
&
our_tree
,
our_commit
))
<
0
)
goto
done
;
error
=
git_merge_trees
(
out
,
repo
,
revert_tree
,
our_tree
,
parent_tree
,
merge_
tree_
opts
);
error
=
git_merge_trees
(
out
,
repo
,
revert_tree
,
our_tree
,
parent_tree
,
merge_opts
);
done:
git_tree_free
(
parent_tree
);
...
...
@@ -198,7 +198,7 @@ int git_revert(
(
error
=
write_merge_msg
(
repo
,
commit_oidstr
,
commit_msg
))
<
0
||
(
error
=
git_repository_head
(
&
our_ref
,
repo
))
<
0
||
(
error
=
git_reference_peel
((
git_object
**
)
&
our_commit
,
our_ref
,
GIT_OBJ_COMMIT
))
<
0
||
(
error
=
git_revert_commit
(
&
index_new
,
repo
,
commit
,
our_commit
,
opts
.
mainline
,
&
opts
.
merge_
tree_
opts
))
<
0
||
(
error
=
git_revert_commit
(
&
index_new
,
repo
,
commit
,
our_commit
,
opts
.
mainline
,
&
opts
.
merge_opts
))
<
0
||
(
error
=
git_merge__indexes
(
repo
,
index_new
))
<
0
||
(
error
=
git_repository_index
(
&
index_repo
,
repo
))
<
0
||
(
error
=
git_checkout_index
(
repo
,
index_repo
,
&
opts
.
checkout_opts
))
<
0
)
...
...
tests/merge/merge_helpers.c
View file @
5aa2ac6d
...
...
@@ -10,7 +10,7 @@
int
merge_trees_from_branches
(
git_index
**
index
,
git_repository
*
repo
,
const
char
*
ours_name
,
const
char
*
theirs_name
,
git_merge_
tree_opt
s
*
opts
)
git_merge_
option
s
*
opts
)
{
git_commit
*
our_commit
,
*
their_commit
,
*
ancestor_commit
=
NULL
;
git_tree
*
our_tree
,
*
their_tree
,
*
ancestor_tree
=
NULL
;
...
...
@@ -55,7 +55,7 @@ int merge_trees_from_branches(
int
merge_commits_from_branches
(
git_index
**
index
,
git_repository
*
repo
,
const
char
*
ours_name
,
const
char
*
theirs_name
,
git_merge_
tree_opt
s
*
opts
)
git_merge_
option
s
*
opts
)
{
git_commit
*
our_commit
,
*
their_commit
;
git_oid
our_oid
,
their_oid
;
...
...
@@ -81,7 +81,7 @@ int merge_commits_from_branches(
int
merge_branches
(
git_merge_result
**
result
,
git_repository
*
repo
,
const
char
*
ours_branch
,
const
char
*
theirs_branch
,
git_merge_
tree_opt
s
*
merge_opts
,
git_checkout_options
*
checkout_opts
)
git_merge_
option
s
*
merge_opts
,
git_checkout_options
*
checkout_opts
)
{
git_reference
*
head_ref
,
*
theirs_ref
;
git_merge_head
*
theirs_head
;
...
...
tests/merge/merge_helpers.h
View file @
5aa2ac6d
...
...
@@ -85,16 +85,16 @@ struct merge_index_conflict_data {
int
merge_trees_from_branches
(
git_index
**
index
,
git_repository
*
repo
,
const
char
*
ours_name
,
const
char
*
theirs_name
,
git_merge_
tree_opt
s
*
opts
);
git_merge_
option
s
*
opts
);
int
merge_commits_from_branches
(
git_index
**
index
,
git_repository
*
repo
,
const
char
*
ours_name
,
const
char
*
theirs_name
,
git_merge_
tree_opt
s
*
opts
);
git_merge_
option
s
*
opts
);
int
merge_branches
(
git_merge_result
**
result
,
git_repository
*
repo
,
const
char
*
ours_branch
,
const
char
*
theirs_branch
,
git_merge_
tree_opt
s
*
merge_opts
,
git_checkout_options
*
checkout_opts
);
git_merge_
option
s
*
merge_opts
,
git_checkout_options
*
checkout_opts
);
int
merge_test_diff_list
(
git_merge_diff_list
*
diff_list
,
const
struct
merge_index_entry
expected
[],
size_t
expected_len
);
...
...
tests/merge/trees/automerge.c
View file @
5aa2ac6d
...
...
@@ -69,7 +69,7 @@ void test_merge_trees_automerge__automerge(void)
{
git_index
*
index
;
const
git_index_entry
*
entry
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
git_blob
*
blob
;
struct
merge_index_entry
merge_index_entries
[]
=
{
...
...
@@ -109,7 +109,7 @@ void test_merge_trees_automerge__automerge(void)
void
test_merge_trees_automerge__favor_ours
(
void
)
{
git_index
*
index
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
ADDED_IN_MASTER_INDEX_ENTRY
,
...
...
@@ -140,7 +140,7 @@ void test_merge_trees_automerge__favor_ours(void)
void
test_merge_trees_automerge__favor_theirs
(
void
)
{
git_index
*
index
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
ADDED_IN_MASTER_INDEX_ENTRY
,
...
...
@@ -171,7 +171,7 @@ void test_merge_trees_automerge__favor_theirs(void)
void
test_merge_trees_automerge__unrelated
(
void
)
{
git_index
*
index
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"233c0919c998ed110a4b6ff36f353aec8b713487"
,
0
,
"added-in-master.txt"
},
...
...
tests/merge/trees/commits.c
View file @
5aa2ac6d
...
...
@@ -22,7 +22,7 @@ void test_merge_trees_commits__automerge(void)
{
git_index
*
index
;
const
git_index_entry
*
entry
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
git_blob
*
blob
;
struct
merge_index_entry
merge_index_entries
[]
=
{
...
...
@@ -71,7 +71,7 @@ void test_merge_trees_commits__automerge(void)
void
test_merge_trees_commits__no_ancestor
(
void
)
{
git_index
*
index
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"233c0919c998ed110a4b6ff36f353aec8b713487"
,
0
,
"added-in-master.txt"
},
...
...
@@ -98,7 +98,7 @@ void test_merge_trees_commits__no_ancestor(void)
void
test_merge_trees_commits__df_conflict
(
void
)
{
git_index
*
index
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"49130a28ef567af9a6a6104c38773fedfa5f9742"
,
2
,
"dir-10"
},
...
...
tests/merge/trees/renames.c
View file @
5aa2ac6d
...
...
@@ -27,7 +27,7 @@ void test_merge_trees_renames__cleanup(void)
void
test_merge_trees_renames__index
(
void
)
{
git_index
*
index
;
git_merge_
tree_opt
s
*
opts
=
NULL
;
git_merge_
option
s
*
opts
=
NULL
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e"
,
0
,
"0a-no-change.txt"
},
...
...
@@ -205,7 +205,7 @@ void test_merge_trees_renames__index(void)
void
test_merge_trees_renames__no_rename_index
(
void
)
{
git_index
*
index
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e"
,
0
,
"0a-no-change.txt"
},
...
...
tests/merge/trees/treediff.c
View file @
5aa2ac6d
...
...
@@ -44,7 +44,7 @@ static void test_find_differences(
git_oid
ancestor_oid
,
ours_oid
,
theirs_oid
;
git_tree
*
ancestor_tree
,
*
ours_tree
,
*
theirs_tree
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
opts
.
flags
|=
GIT_MERGE_TREE_FIND_RENAMES
;
opts
.
target_limit
=
1000
;
opts
.
rename_threshold
=
50
;
...
...
tests/merge/trees/trivial.c
View file @
5aa2ac6d
...
...
@@ -31,7 +31,7 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
git_tree
*
our_tree
,
*
their_tree
,
*
ancestor_tree
;
git_oid
our_oid
,
their_oid
,
ancestor_oid
;
git_buf
branch_buf
=
GIT_BUF_INIT
;
git_merge_
tree_opts
opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
opts
=
GIT_MERGE_OPTION
S_INIT
;
git_buf_printf
(
&
branch_buf
,
"%s%s"
,
GIT_REFS_HEADS_DIR
,
ours
);
cl_git_pass
(
git_reference_name_to_id
(
&
our_oid
,
repo
,
branch_buf
.
ptr
));
...
...
tests/merge/workdir/dirty.c
View file @
5aa2ac6d
...
...
@@ -90,7 +90,7 @@ static int merge_branch(git_merge_result **result, int merge_file_favor, int che
{
git_oid
their_oids
[
1
];
git_merge_head
*
their_heads
[
1
];
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
git_checkout_options
checkout_opts
=
GIT_CHECKOUT_OPTIONS_INIT
;
int
error
;
...
...
tests/merge/workdir/renames.c
View file @
5aa2ac6d
...
...
@@ -35,7 +35,7 @@ void test_merge_workdir_renames__cleanup(void)
void
test_merge_workdir_renames__renames
(
void
)
{
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e"
,
0
,
"0a-no-change.txt"
},
...
...
@@ -77,7 +77,7 @@ void test_merge_workdir_renames__ours(void)
{
git_index
*
index
;
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
git_checkout_options
checkout_opts
=
GIT_CHECKOUT_OPTIONS_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
...
...
@@ -119,7 +119,7 @@ void test_merge_workdir_renames__ours(void)
void
test_merge_workdir_renames__similar
(
void
)
{
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
/*
* Note: this differs slightly from the core git merge result - there, 4a is
...
...
tests/merge/workdir/simple.c
View file @
5aa2ac6d
...
...
@@ -97,7 +97,7 @@ static git_merge_result *merge_simple_branch(int merge_file_favor, int checkout_
git_oid
their_oids
[
1
];
git_merge_head
*
their_heads
[
1
];
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
git_checkout_options
checkout_opts
=
GIT_CHECKOUT_OPTIONS_INIT
;
cl_git_pass
(
git_oid_fromstr
(
&
their_oids
[
0
],
THEIRS_SIMPLE_OID
));
...
...
@@ -523,7 +523,7 @@ void test_merge_workdir_simple__directory_file(void)
git_oid
their_oids
[
1
],
head_commit_id
;
git_merge_head
*
their_heads
[
1
];
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
git_commit
*
head_commit
;
struct
merge_index_entry
merge_index_entries
[]
=
{
...
...
@@ -573,7 +573,7 @@ void test_merge_workdir_simple__unrelated(void)
git_oid
their_oids
[
1
];
git_merge_head
*
their_heads
[
1
];
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"233c0919c998ed110a4b6ff36f353aec8b713487"
,
0
,
"added-in-master.txt"
},
...
...
@@ -604,7 +604,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void)
git_oid
their_oids
[
1
];
git_merge_head
*
their_heads
[
1
];
git_merge_result
*
result
;
git_merge_
tree_opts
merge_opts
=
GIT_MERGE_TREE_OPT
S_INIT
;
git_merge_
options
merge_opts
=
GIT_MERGE_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"233c0919c998ed110a4b6ff36f353aec8b713487"
,
0
,
"added-in-master.txt"
},
...
...
tests/revert/workdir.c
View file @
5aa2ac6d
...
...
@@ -398,8 +398,8 @@ void test_revert_workdir__rename_1_of_2(void)
{
0100644
,
"0f5bfcf58c558d865da6be0281d7795993646cee"
,
2
,
"file6.txt"
},
};
opts
.
merge_
tree_
opts
.
flags
|=
GIT_MERGE_TREE_FIND_RENAMES
;
opts
.
merge_
tree_
opts
.
rename_threshold
=
50
;
opts
.
merge_opts
.
flags
|=
GIT_MERGE_TREE_FIND_RENAMES
;
opts
.
merge_opts
.
rename_threshold
=
50
;
git_oid_fromstr
(
&
head_oid
,
"cef56612d71a6af8d8015691e4865f7fece905b5"
);
cl_git_pass
(
git_commit_lookup
(
&
head
,
repo
,
&
head_oid
));
...
...
@@ -432,8 +432,8 @@ void test_revert_workdir__rename(void)
{
"file4.txt"
,
"file5.txt"
,
""
},
};
opts
.
merge_
tree_
opts
.
flags
|=
GIT_MERGE_TREE_FIND_RENAMES
;
opts
.
merge_
tree_
opts
.
rename_threshold
=
50
;
opts
.
merge_opts
.
flags
|=
GIT_MERGE_TREE_FIND_RENAMES
;
opts
.
merge_opts
.
rename_threshold
=
50
;
git_oid_fromstr
(
&
head_oid
,
"55568c8de5322ff9a95d72747a239cdb64a19965"
);
cl_git_pass
(
git_commit_lookup
(
&
head
,
repo
,
&
head_oid
));
...
...
tests/structinit/structinit.c
View file @
5aa2ac6d
...
...
@@ -77,8 +77,8 @@ void test_structinit_structinit__compare(void)
/* merge_tree */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_merge_
tree_opts
,
GIT_MERGE_TREE_OPT
S_VERSION
,
\
GIT_MERGE_
TREE_OPTS_INIT
,
git_merge_tree_init_opt
s
);
git_merge_
options
,
GIT_MERGE_OPTION
S_VERSION
,
\
GIT_MERGE_
OPTIONS_INIT
,
git_merge_init_option
s
);
/* push */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
...
...
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