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
9c9aa1ba
Commit
9c9aa1ba
authored
Feb 19, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter: take `temp_buf` in `git_filter_options`
parent
d05218b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
src/checkout.c
+2
-3
src/filter.c
+6
-7
src/filter.h
+1
-3
No files found.
src/checkout.c
View file @
9c9aa1ba
...
...
@@ -1440,6 +1440,7 @@ static int blob_content_to_file(
}
filter_opts
.
attr_session
=
&
data
->
attr_session
;
filter_opts
.
temp_buf
=
&
data
->
tmp
;
if
(
!
data
->
opts
.
disable_filters
&&
(
error
=
git_filter_list__load_ext
(
...
...
@@ -1447,9 +1448,6 @@ static int blob_content_to_file(
GIT_FILTER_TO_WORKTREE
,
&
filter_opts
)))
return
error
;
if
(
fl
)
git_filter_list__set_temp_buf
(
fl
,
&
data
->
tmp
);
/* setup the writer */
memset
(
&
writer
,
0
,
sizeof
(
struct
checkout_stream
));
writer
.
base
.
write
=
checkout_stream_write
;
...
...
@@ -2057,6 +2055,7 @@ static int checkout_write_merge(
in_data
.
size
=
result
.
len
;
filter_opts
.
attr_session
=
&
data
->
attr_session
;
filter_opts
.
temp_buf
=
&
data
->
tmp
;
if
((
error
=
git_filter_list__load_ext
(
&
fl
,
data
->
repo
,
NULL
,
git_buf_cstr
(
&
path_workdir
),
...
...
src/filter.c
View file @
9c9aa1ba
...
...
@@ -517,8 +517,12 @@ int git_filter_list__load_ext(
else
if
(
error
<
0
)
break
;
else
{
if
(
!
fl
&&
(
error
=
filter_list_new
(
&
fl
,
&
src
))
<
0
)
return
error
;
if
(
!
fl
)
{
if
((
error
=
filter_list_new
(
&
fl
,
&
src
))
<
0
)
return
error
;
fl
->
temp_buf
=
filter_opts
->
temp_buf
;
}
fe
=
git_array_alloc
(
fl
->
filters
);
GITERR_CHECK_ALLOC
(
fe
);
...
...
@@ -553,11 +557,6 @@ int git_filter_list_load(
filters
,
repo
,
blob
,
path
,
mode
,
&
filter_opts
);
}
void
git_filter_list__set_temp_buf
(
git_filter_list
*
fl
,
git_buf
*
temp_buf
)
{
fl
->
temp_buf
=
temp_buf
;
}
void
git_filter_list_free
(
git_filter_list
*
fl
)
{
uint32_t
i
;
...
...
src/filter.h
View file @
9c9aa1ba
...
...
@@ -26,14 +26,12 @@ typedef enum {
typedef
struct
{
git_attr_session
*
attr_session
;
git_buf
*
temp_buf
;
uint32_t
flags
;
}
git_filter_options
;
#define GIT_FILTER_OPTIONS_INIT {0}
extern
void
git_filter_list__set_temp_buf
(
git_filter_list
*
fl
,
git_buf
*
temp_buf
);
extern
void
git_filter_free
(
git_filter
*
filter
);
extern
int
git_filter_list__load_ext
(
...
...
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