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
7a3ab14f
Commit
7a3ab14f
authored
Feb 07, 2016
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge driver: get a pointer to favor
parent
46625836
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/merge.c
+1
-1
src/merge_driver.c
+8
-3
No files found.
src/merge.c
View file @
7a3ab14f
...
...
@@ -918,7 +918,7 @@ static int merge_conflict_resolve_contents(
* favor flag) then let that override the gitattributes.
*/
driver
=
&
git_merge_driver__normal
;
data
=
(
void
*
)
file_opts
->
favor
;
data
=
(
void
*
*
)
&
file_opts
->
favor
;
}
else
{
/* find the merge driver for this file */
if
((
error
=
git_merge_driver_for_source
(
&
driver
,
&
data
,
&
source
))
<
0
)
...
...
src/merge_driver.c
View file @
7a3ab14f
...
...
@@ -28,6 +28,9 @@ typedef struct {
static
struct
merge_driver_registry
*
merge_driver_registry
=
NULL
;
static
git_merge_file_favor_t
merge_favor_normal
=
GIT_MERGE_FILE_FAVOR_NORMAL
;
static
git_merge_file_favor_t
merge_favor_union
=
GIT_MERGE_FILE_FAVOR_UNION
;
static
int
merge_driver_apply
(
git_merge_driver
*
self
,
void
**
payload
,
...
...
@@ -37,6 +40,7 @@ static int merge_driver_apply(
const
git_merge_driver_source
*
src
)
{
git_merge_file_options
file_opts
=
GIT_MERGE_FILE_OPTIONS_INIT
;
git_merge_file_favor_t
*
favor
=
(
git_merge_file_favor_t
*
)
*
payload
;
git_merge_file_result
result
=
{
0
};
int
error
;
...
...
@@ -45,7 +49,8 @@ static int merge_driver_apply(
if
(
src
->
file_opts
)
memcpy
(
&
file_opts
,
src
->
file_opts
,
sizeof
(
git_merge_file_options
));
file_opts
.
favor
=
(
git_merge_file_favor_t
)
*
payload
;
if
(
favor
)
file_opts
.
favor
=
*
favor
;
if
((
error
=
git_merge_file_from_index
(
&
result
,
src
->
repo
,
src
->
ancestor
,
src
->
ours
,
src
->
theirs
,
&
file_opts
))
<
0
)
...
...
@@ -87,7 +92,7 @@ static int merge_driver_text_check(
GIT_UNUSED
(
name
);
GIT_UNUSED
(
src
);
*
payload
=
(
void
*
)
GIT_MERGE_FILE_FAVOR_NORMAL
;
*
payload
=
&
merge_favor_normal
;
return
0
;
}
...
...
@@ -101,7 +106,7 @@ static int merge_driver_union_check(
GIT_UNUSED
(
name
);
GIT_UNUSED
(
src
);
*
payload
=
(
void
*
)
GIT_MERGE_FILE_FAVOR_UNION
;
*
payload
=
&
merge_favor_union
;
return
0
;
}
...
...
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