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
f887fd60
Unverified
Commit
f887fd60
authored
Jun 22, 2022
by
John Alden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy back git_buf after callback
parent
e0a8b4e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
src/libgit2/filter.c
+16
-6
No files found.
src/libgit2/filter.c
View file @
f887fd60
...
@@ -893,6 +893,17 @@ static int buffered_stream_write(
...
@@ -893,6 +893,17 @@ static int buffered_stream_write(
return
git_str_put
(
&
buffered_stream
->
input
,
buffer
,
len
);
return
git_str_put
(
&
buffered_stream
->
input
,
buffer
,
len
);
}
}
#ifndef GIT_DEPRECATE_HARD
# define BUF_TO_STRUCT(b, s) \
(b)->ptr = (s)->ptr; \
(b)->size = (s)->size; \
(b)->reserved = (s)->asize;
# define STRUCT_TO_BUF(s, b) \
(s)->ptr = (b)->ptr; \
(s)->size = (b)->size; \
(s)->asize = (b)->reserved;
#endif
static
int
buffered_stream_close
(
git_writestream
*
s
)
static
int
buffered_stream_close
(
git_writestream
*
s
)
{
{
struct
buffered_stream
*
buffered_stream
=
(
struct
buffered_stream
*
)
s
;
struct
buffered_stream
*
buffered_stream
=
(
struct
buffered_stream
*
)
s
;
...
@@ -907,12 +918,8 @@ static int buffered_stream_close(git_writestream *s)
...
@@ -907,12 +918,8 @@ static int buffered_stream_close(git_writestream *s)
git_buf
legacy_output
=
GIT_BUF_INIT
,
git_buf
legacy_output
=
GIT_BUF_INIT
,
legacy_input
=
GIT_BUF_INIT
;
legacy_input
=
GIT_BUF_INIT
;
legacy_output
.
ptr
=
buffered_stream
->
output
->
ptr
;
BUF_TO_STRUCT
(
&
legacy_output
,
buffered_stream
->
output
);
legacy_output
.
size
=
buffered_stream
->
output
->
size
;
BUF_TO_STRUCT
(
&
legacy_input
,
&
buffered_stream
->
input
);
legacy_output
.
reserved
=
buffered_stream
->
output
->
asize
;
legacy_input
.
ptr
=
buffered_stream
->
input
.
ptr
;
legacy_input
.
size
=
buffered_stream
->
input
.
size
;
legacy_input
.
reserved
=
buffered_stream
->
input
.
asize
;
error
=
buffered_stream
->
legacy_write_fn
(
error
=
buffered_stream
->
legacy_write_fn
(
buffered_stream
->
filter
,
buffered_stream
->
filter
,
...
@@ -920,6 +927,9 @@ static int buffered_stream_close(git_writestream *s)
...
@@ -920,6 +927,9 @@ static int buffered_stream_close(git_writestream *s)
&
legacy_output
,
&
legacy_output
,
&
legacy_input
,
&
legacy_input
,
buffered_stream
->
source
);
buffered_stream
->
source
);
STRUCT_TO_BUF
(
buffered_stream
->
output
,
&
legacy_output
);
STRUCT_TO_BUF
(
&
buffered_stream
->
input
,
&
legacy_input
);
}
else
}
else
#endif
#endif
error
=
buffered_stream
->
write_fn
(
error
=
buffered_stream
->
write_fn
(
...
...
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