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
a1bbc0ce
Commit
a1bbc0ce
authored
Jan 25, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge: rename _oid() -> id()
Following the rest of the series, use 'id' when refering to the value.
parent
86bfc3e1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
56 deletions
+56
-56
include/git2/merge.h
+4
-4
src/merge.c
+3
-3
tests/merge/workdir/fastforward.c
+5
-5
tests/merge/workdir/setup.c
+39
-39
tests/merge/workdir/simple.c
+5
-5
No files found.
include/git2/merge.h
View file @
a1bbc0ce
...
...
@@ -160,13 +160,13 @@ GIT_EXTERN(int) git_merge_head_from_fetchhead(
*
* @param out pointer to store the git_merge_head result in
* @param repo repository that contains the given commit
* @param
o
id the commit object id to use as a merge input
* @param id the commit object id to use as a merge input
* @return zero on success, -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_head_from_
o
id
(
GIT_EXTERN
(
int
)
git_merge_head_from_id
(
git_merge_head
**
out
,
git_repository
*
repo
,
const
git_oid
*
o
id
);
const
git_oid
*
id
);
/**
* Frees a `git_merge_head`
...
...
@@ -251,7 +251,7 @@ GIT_EXTERN(int) git_merge_result_is_fastforward(git_merge_result *merge_result);
* @param out the OID of the fast-forward
* @param merge_result the results of the merge
*/
GIT_EXTERN
(
int
)
git_merge_result_fastforward_
o
id
(
git_oid
*
out
,
git_merge_result
*
merge_result
);
GIT_EXTERN
(
int
)
git_merge_result_fastforward_id
(
git_oid
*
out
,
git_merge_result
*
merge_result
);
GIT_EXTERN
(
void
)
git_merge_result_free
(
git_merge_result
*
merge_result
);
...
...
src/merge.c
View file @
a1bbc0ce
...
...
@@ -2111,7 +2111,7 @@ static int merge_ancestor_head(
if
((
error
=
git_merge_base_many
(
&
ancestor_oid
,
repo
,
their_heads_len
+
1
,
oids
))
<
0
)
goto
on_error
;
error
=
git_merge_head_from_
o
id
(
ancestor_head
,
repo
,
&
ancestor_oid
);
error
=
git_merge_head_from_id
(
ancestor_head
,
repo
,
&
ancestor_oid
);
on_error:
git__free
(
oids
);
...
...
@@ -2615,7 +2615,7 @@ int git_merge_result_is_fastforward(git_merge_result *merge_result)
return
merge_result
->
is_fastforward
;
}
int
git_merge_result_fastforward_
o
id
(
git_oid
*
out
,
git_merge_result
*
merge_result
)
int
git_merge_result_fastforward_id
(
git_oid
*
out
,
git_merge_result
*
merge_result
)
{
assert
(
out
&&
merge_result
);
...
...
@@ -2699,7 +2699,7 @@ int git_merge_head_from_ref(
return
error
;
}
int
git_merge_head_from_
o
id
(
int
git_merge_head_from_id
(
git_merge_head
**
out
,
git_repository
*
repo
,
const
git_oid
*
oid
)
...
...
tests/merge/workdir/fastforward.c
View file @
a1bbc0ce
...
...
@@ -13,10 +13,10 @@ static git_index *repo_index;
#define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
#define THEIRS_FASTFORWARD_BRANCH "ff_branch"
#define THEIRS_FASTFORWARD_
O
ID "fd89f8cffb663ac89095a0f9764902e93ceaca6a"
#define THEIRS_FASTFORWARD_ID "fd89f8cffb663ac89095a0f9764902e93ceaca6a"
#define THEIRS_NOFASTFORWARD_BRANCH "branch"
#define THEIRS_NOFASTFORWARD_
O
ID "7cb63eed597130ba4abb87b3e544b85021905520"
#define THEIRS_NOFASTFORWARD_ID "7cb63eed597130ba4abb87b3e544b85021905520"
// Fixture setup and teardown
...
...
@@ -57,11 +57,11 @@ void test_merge_workdir_fastforward__fastforward(void)
git_merge_result
*
result
;
git_oid
expected
,
ff_oid
;
cl_git_pass
(
git_oid_fromstr
(
&
expected
,
THEIRS_FASTFORWARD_
O
ID
));
cl_git_pass
(
git_oid_fromstr
(
&
expected
,
THEIRS_FASTFORWARD_ID
));
cl_assert
(
result
=
merge_fastforward_branch
(
0
));
cl_assert
(
git_merge_result_is_fastforward
(
result
));
cl_git_pass
(
git_merge_result_fastforward_
o
id
(
&
ff_oid
,
result
));
cl_git_pass
(
git_merge_result_fastforward_id
(
&
ff_oid
,
result
));
cl_assert
(
git_oid_cmp
(
&
ff_oid
,
&
expected
)
==
0
);
git_merge_result_free
(
result
);
...
...
@@ -136,7 +136,7 @@ void test_merge_workdir_fastforward__uptodate_merging_prev_commit(void)
git_merge_result
*
result
;
cl_git_pass
(
git_oid_fromstr
(
&
their_oid
,
"c607fc30883e335def28cd686b51f6cfa02b06ec"
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
their_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
their_oid
));
cl_git_pass
(
git_merge
(
&
result
,
repo
,
(
const
git_merge_head
**
)
their_heads
,
1
,
NULL
));
...
...
tests/merge/workdir/setup.c
View file @
a1bbc0ce
...
...
@@ -79,7 +79,7 @@ void test_merge_workdir_setup__one_branch(void)
git_merge_head
*
our_head
,
*
their_heads
[
1
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -105,7 +105,7 @@ void test_merge_workdir_setup__no_fastforward(void)
git_merge_head
*
our_head
,
*
their_heads
[
1
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -131,10 +131,10 @@ void test_merge_workdir_setup__one_oid(void)
git_merge_head
*
our_head
,
*
their_heads
[
1
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_merge__setup
(
repo
,
our_head
,
(
const
git_merge_head
**
)
their_heads
,
1
,
0
));
...
...
@@ -156,7 +156,7 @@ void test_merge_workdir_setup__two_branches(void)
git_merge_head
*
our_head
,
*
their_heads
[
2
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -189,7 +189,7 @@ void test_merge_workdir_setup__three_branches(void)
git_merge_head
*
our_head
,
*
their_heads
[
3
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -227,16 +227,16 @@ void test_merge_workdir_setup__three_oids(void)
git_merge_head
*
our_head
,
*
their_heads
[
3
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo2_oid
,
OCTO2_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
1
],
repo
,
&
octo2_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
1
],
repo
,
&
octo2_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo3_oid
,
OCTO3_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
2
],
repo
,
&
octo3_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
2
],
repo
,
&
octo3_oid
));
cl_git_pass
(
git_merge__setup
(
repo
,
our_head
,
(
const
git_merge_head
**
)
their_heads
,
3
,
0
));
...
...
@@ -260,13 +260,13 @@ void test_merge_workdir_setup__branches_and_oids_1(void)
git_merge_head
*
our_head
,
*
their_heads
[
2
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
cl_git_pass
(
git_oid_fromstr
(
&
octo2_oid
,
OCTO2_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
1
],
repo
,
&
octo2_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
1
],
repo
,
&
octo2_oid
));
cl_git_pass
(
git_merge__setup
(
repo
,
our_head
,
(
const
git_merge_head
**
)
their_heads
,
2
,
0
));
...
...
@@ -293,19 +293,19 @@ void test_merge_workdir_setup__branches_and_oids_2(void)
git_merge_head
*
our_head
,
*
their_heads
[
4
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
cl_git_pass
(
git_oid_fromstr
(
&
octo2_oid
,
OCTO2_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
1
],
repo
,
&
octo2_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
1
],
repo
,
&
octo2_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo3_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO3_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
2
],
repo
,
octo3_ref
));
cl_git_pass
(
git_oid_fromstr
(
&
octo4_oid
,
OCTO4_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
3
],
repo
,
&
octo4_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
3
],
repo
,
&
octo4_oid
));
cl_git_pass
(
git_merge__setup
(
repo
,
our_head
,
(
const
git_merge_head
**
)
their_heads
,
4
,
0
));
...
...
@@ -335,16 +335,16 @@ void test_merge_workdir_setup__branches_and_oids_3(void)
git_merge_head
*
our_head
,
*
their_heads
[
4
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo2_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO2_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
1
],
repo
,
octo2_ref
));
cl_git_pass
(
git_oid_fromstr
(
&
octo3_oid
,
OCTO3_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
2
],
repo
,
&
octo3_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
2
],
repo
,
&
octo3_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo4_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO4_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
3
],
repo
,
octo4_ref
));
...
...
@@ -378,16 +378,16 @@ void test_merge_workdir_setup__branches_and_oids_4(void)
git_merge_head
*
our_head
,
*
their_heads
[
5
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
octo1_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo2_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO2_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
1
],
repo
,
octo2_ref
));
cl_git_pass
(
git_oid_fromstr
(
&
octo3_oid
,
OCTO3_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
2
],
repo
,
&
octo3_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
2
],
repo
,
&
octo3_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo4_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO4_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
3
],
repo
,
octo4_ref
));
...
...
@@ -424,7 +424,7 @@ void test_merge_workdir_setup__three_same_branches(void)
git_merge_head
*
our_head
,
*
their_heads
[
3
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_1_ref
));
...
...
@@ -462,16 +462,16 @@ void test_merge_workdir_setup__three_same_oids(void)
git_merge_head
*
our_head
,
*
their_heads
[
3
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
octo1_1_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
octo1_1_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_2_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
1
],
repo
,
&
octo1_2_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
1
],
repo
,
&
octo1_2_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_3_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
2
],
repo
,
&
octo1_3_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
2
],
repo
,
&
octo1_3_oid
));
cl_git_pass
(
git_merge__setup
(
repo
,
our_head
,
(
const
git_merge_head
**
)
their_heads
,
3
,
0
));
...
...
@@ -539,7 +539,7 @@ void test_merge_workdir_setup__remote_tracking_one_branch(void)
cl_git_pass
(
create_remote_tracking_branch
(
OCTO1_BRANCH
,
OCTO1_OID
));
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_REMOTES_DIR
"origin/"
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -569,7 +569,7 @@ void test_merge_workdir_setup__remote_tracking_two_branches(void)
cl_git_pass
(
create_remote_tracking_branch
(
OCTO2_BRANCH
,
OCTO2_OID
));
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_REMOTES_DIR
"origin/"
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -606,7 +606,7 @@ void test_merge_workdir_setup__remote_tracking_three_branches(void)
cl_git_pass
(
create_remote_tracking_branch
(
OCTO3_BRANCH
,
OCTO3_OID
));
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_REMOTES_DIR
"origin/"
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -645,7 +645,7 @@ void test_merge_workdir_setup__normal_branch_and_remote_tracking_branch(void)
cl_git_pass
(
create_remote_tracking_branch
(
OCTO2_BRANCH
,
OCTO2_OID
));
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -679,7 +679,7 @@ void test_merge_workdir_setup__remote_tracking_branch_and_normal_branch(void)
cl_git_pass
(
create_remote_tracking_branch
(
OCTO1_BRANCH
,
OCTO1_OID
));
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_REMOTES_DIR
"origin/"
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -716,7 +716,7 @@ void test_merge_workdir_setup__two_remote_tracking_branch_and_two_normal_branche
cl_git_pass
(
create_remote_tracking_branch
(
OCTO4_BRANCH
,
OCTO4_OID
));
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
@@ -757,7 +757,7 @@ void test_merge_workdir_setup__pull_one(void)
git_merge_head
*
our_head
,
*
their_heads
[
1
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_fetchhead
(
&
their_heads
[
0
],
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
,
"http://remote.url/repo.git"
,
&
octo1_1_oid
));
...
...
@@ -782,7 +782,7 @@ void test_merge_workdir_setup__pull_two(void)
git_merge_head
*
our_head
,
*
their_heads
[
2
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_fetchhead
(
&
their_heads
[
0
],
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
,
"http://remote.url/repo.git"
,
&
octo1_oid
));
...
...
@@ -812,7 +812,7 @@ void test_merge_workdir_setup__pull_three(void)
git_merge_head
*
our_head
,
*
their_heads
[
3
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_fetchhead
(
&
their_heads
[
0
],
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
,
"http://remote.url/repo.git"
,
&
octo1_oid
));
...
...
@@ -845,7 +845,7 @@ void test_merge_workdir_setup__three_remotes(void)
git_merge_head
*
our_head
,
*
their_heads
[
3
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_fetchhead
(
&
their_heads
[
0
],
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
,
"http://remote.first/repo.git"
,
&
octo1_oid
));
...
...
@@ -879,7 +879,7 @@ void test_merge_workdir_setup__two_remotes(void)
git_merge_head
*
our_head
,
*
their_heads
[
4
];
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
octo1_oid
,
OCTO1_OID
));
cl_git_pass
(
git_merge_head_from_fetchhead
(
&
their_heads
[
0
],
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
,
"http://remote.first/repo.git"
,
&
octo1_oid
));
...
...
@@ -1002,7 +1002,7 @@ void test_merge_workdir_setup__retained_after_success(void)
opts
.
merge_flags
|=
GIT_MERGE_NO_FASTFORWARD
;
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
...
...
@@ -1033,7 +1033,7 @@ void test_merge_workdir_setup__removed_after_failure(void)
opts
.
merge_flags
|=
GIT_MERGE_NO_FASTFORWARD
;
cl_git_pass
(
git_oid_fromstr
(
&
our_oid
,
ORIG_HEAD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
our_head
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reference_lookup
(
&
octo1_ref
,
repo
,
GIT_REFS_HEADS_DIR
OCTO1_BRANCH
));
cl_git_pass
(
git_merge_head_from_ref
(
&
their_heads
[
0
],
repo
,
octo1_ref
));
...
...
tests/merge/workdir/simple.c
View file @
a1bbc0ce
...
...
@@ -134,7 +134,7 @@ static git_merge_result *merge_simple_branch(int merge_file_favor, int checkout_
git_merge_opts
opts
=
GIT_MERGE_OPTS_INIT
;
cl_git_pass
(
git_oid_fromstr
(
&
their_oids
[
0
],
THEIRS_SIMPLE_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
opts
.
merge_tree_opts
.
file_favor
=
merge_file_favor
;
opts
.
checkout_opts
.
checkout_strategy
=
checkout_strategy
;
...
...
@@ -588,7 +588,7 @@ void test_merge_workdir_simple__directory_file(void)
cl_git_pass
(
git_reset
(
repo
,
(
git_object
*
)
head_commit
,
GIT_RESET_HARD
));
cl_git_pass
(
git_oid_fromstr
(
&
their_oids
[
0
],
THEIRS_DIRECTORY_FILE
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
opts
.
merge_tree_opts
.
file_favor
=
0
;
cl_git_pass
(
git_merge
(
&
result
,
repo
,
(
const
git_merge_head
**
)
their_heads
,
1
,
&
opts
));
...
...
@@ -621,7 +621,7 @@ void test_merge_workdir_simple__unrelated(void)
};
cl_git_pass
(
git_oid_fromstr
(
&
their_oids
[
0
],
THEIRS_UNRELATED_PARENT
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
opts
.
merge_tree_opts
.
file_favor
=
0
;
cl_git_pass
(
git_merge
(
&
result
,
repo
,
(
const
git_merge_head
**
)
their_heads
,
1
,
&
opts
));
...
...
@@ -654,7 +654,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void)
};
cl_git_pass
(
git_oid_fromstr
(
&
their_oids
[
0
],
THEIRS_UNRELATED_OID
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
cl_git_pass
(
git_merge_head_from_id
(
&
their_heads
[
0
],
repo
,
&
their_oids
[
0
]));
opts
.
merge_tree_opts
.
file_favor
=
0
;
cl_git_pass
(
git_merge
(
&
result
,
repo
,
(
const
git_merge_head
**
)
their_heads
,
1
,
&
opts
));
...
...
@@ -686,7 +686,7 @@ void test_merge_workdir_simple__binary(void)
cl_git_pass
(
git_commit_lookup
(
&
our_commit
,
repo
,
&
our_oid
));
cl_git_pass
(
git_reset
(
repo
,
(
git_object
*
)
our_commit
,
GIT_RESET_HARD
));
cl_git_pass
(
git_merge_head_from_
o
id
(
&
their_head
,
repo
,
&
their_oid
));
cl_git_pass
(
git_merge_head_from_id
(
&
their_head
,
repo
,
&
their_oid
));
cl_git_pass
(
git_merge
(
&
result
,
repo
,
(
const
git_merge_head
**
)
&
their_head
,
1
,
&
opts
));
...
...
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