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
14e805a2
Commit
14e805a2
authored
Jul 24, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3304 from libgit2/cmn/checkout-free-stream
filter: make sure to close the stream even on error
parents
4e0421fd
4de7f3bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
src/filter.c
+9
-7
No files found.
src/filter.c
View file @
14e805a2
...
@@ -950,18 +950,20 @@ int git_filter_list_stream_data(
...
@@ -950,18 +950,20 @@ int git_filter_list_stream_data(
{
{
git_vector
filter_streams
=
GIT_VECTOR_INIT
;
git_vector
filter_streams
=
GIT_VECTOR_INIT
;
git_writestream
*
stream_start
;
git_writestream
*
stream_start
;
int
error
=
0
;
int
error
=
0
,
close_error
;
git_buf_sanitize
(
data
);
git_buf_sanitize
(
data
);
if
((
error
=
stream_list_init
(
if
((
error
=
stream_list_init
(
&
stream_start
,
&
filter_streams
,
filters
,
target
))
<
0
)
&
stream_start
,
&
filter_streams
,
filters
,
target
))
==
0
&&
goto
out
;
(
error
=
stream_start
->
write
(
stream_start
,
data
->
ptr
,
data
->
size
))
==
0
)
error
=
stream_start
->
close
(
stream_start
);
error
=
stream_start
->
write
(
stream_start
,
data
->
ptr
,
data
->
size
);
out:
close_error
=
stream_start
->
close
(
stream_start
);
stream_list_free
(
&
filter_streams
);
stream_list_free
(
&
filter_streams
);
return
error
;
/* propagate the stream init or write error */
return
error
<
0
?
error
:
close_error
;
}
}
int
git_filter_list_stream_blob
(
int
git_filter_list_stream_blob
(
...
...
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