diff options
author | Edward Thomson <ethomson@microsoft.com> | 2015-03-23 13:12:55 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-03-25 10:20:59 -0400 |
commit | 669ae274228eb4157b50d9d488c83b5f3802c324 (patch) | |
tree | 7bf368fe8a5ce12cc9a0883da93ce6bafa992a5a | |
parent | 7c2b9e063b23f804ee056db177cd1b5e66832ccd (diff) | |
download | libgit2-669ae274228eb4157b50d9d488c83b5f3802c324.tar.gz |
filter: clear the temp_buf if we're using one
If we are using a temporary buffer for filtering, be sure to clear
it before using it, in case the file that we are filtering is empty.
-rw-r--r-- | src/filter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/filter.c b/src/filter.c index 6d0d48015..8bd7f4d07 100644 --- a/src/filter.c +++ b/src/filter.c @@ -809,6 +809,9 @@ static int proxy_stream_init( proxy_stream->target = target; proxy_stream->output = temp_buf ? temp_buf : &proxy_stream->temp_buf; + if (temp_buf) + git_buf_clear(temp_buf); + *out = (git_writestream *)proxy_stream; return 0; } |