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
5e2cf2ca
Commit
5e2cf2ca
authored
Oct 10, 2014
by
Jacques Germishuys
Committed by
Edward Thomson
Oct 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure filters (i.e. CRLF) are applied when checking out conflict content
parent
8d3b2ee3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
src/checkout.c
+19
-3
No files found.
src/checkout.c
View file @
5e2cf2ca
...
...
@@ -1761,10 +1761,12 @@ static int checkout_write_merge(
checkout_conflictdata
*
conflict
)
{
git_buf
our_label
=
GIT_BUF_INIT
,
their_label
=
GIT_BUF_INIT
,
path_suffixed
=
GIT_BUF_INIT
,
path_workdir
=
GIT_BUF_INIT
;
path_suffixed
=
GIT_BUF_INIT
,
path_workdir
=
GIT_BUF_INIT
,
in_data
=
GIT_BUF_INIT
,
out_data
=
GIT_BUF_INIT
;
git_merge_file_options
opts
=
GIT_MERGE_FILE_OPTIONS_INIT
;
git_merge_file_result
result
=
{
0
};
git_filebuf
output
=
GIT_FILEBUF_INIT
;
git_filter_list
*
fl
=
NULL
;
int
error
=
0
;
if
(
data
->
opts
.
checkout_strategy
&
GIT_CHECKOUT_CONFLICT_STYLE_DIFF3
)
...
...
@@ -1810,13 +1812,27 @@ static int checkout_write_merge(
(
error
=
checkout_safe_for_update_only
(
git_buf_cstr
(
&
path_workdir
),
result
.
mode
))
<=
0
)
goto
done
;
if
(
!
data
->
opts
.
disable_filters
)
{
if
((
error
=
git_buf_put
(
&
in_data
,
result
.
ptr
,
result
.
len
))
<
0
||
(
error
=
git_filter_list_load
(
&
fl
,
data
->
repo
,
NULL
,
git_buf_cstr
(
&
path_workdir
),
GIT_FILTER_TO_WORKTREE
,
GIT_FILTER_OPT_DEFAULT
))
<
0
||
(
error
=
git_filter_list_apply_to_data
(
&
out_data
,
fl
,
&
in_data
))
<
0
)
goto
done
;
}
else
if
((
error
=
git_buf_put
(
&
out_data
,
result
.
ptr
,
result
.
len
))
<
0
)
goto
done
;
if
((
error
=
git_futils_mkpath2file
(
path_workdir
.
ptr
,
0755
))
<
0
||
(
error
=
git_filebuf_open
(
&
output
,
path_workdir
.
ptr
,
GIT_FILEBUF_DO_NOT_BUFFER
,
result
.
mode
))
<
0
||
(
error
=
git_filebuf_write
(
&
output
,
result
.
ptr
,
result
.
len
))
<
0
||
(
error
=
git_filebuf_open
(
&
output
,
git_buf_cstr
(
&
path_workdir
)
,
GIT_FILEBUF_DO_NOT_BUFFER
,
result
.
mode
))
<
0
||
(
error
=
git_filebuf_write
(
&
output
,
out_data
.
ptr
,
out_data
.
size
))
<
0
||
(
error
=
git_filebuf_commit
(
&
output
))
<
0
)
goto
done
;
done
:
git_filter_list_free
(
fl
);
git_buf_free
(
&
out_data
);
git_buf_free
(
&
in_data
);
git_buf_free
(
&
our_label
);
git_buf_free
(
&
their_label
);
...
...
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