aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-10 02:14:22 +0900
committerJunio C Hamano <gitster@pobox.com>2019-04-10 02:14:22 +0900
commit1828e52efcffe75707b88345f025c3ee4114864a (patch)
treebf5635815ead7340d26ab8f6a35063a81945fd1a
parentb582c1681ed9579ced82b72f26119cec0859e64c (diff)
parent02156ab031e430bc45ce6984dfc712de9962dec8 (diff)
downloadgit-1828e52efcffe75707b88345f025c3ee4114864a.tar.gz
Merge branch 'jh/resize-convert-scratch-buffer'
When the "clean" filter can reduce the size of a huge file in the working tree down to a small "token" (a la Git LFS), there is no point in allocating a huge scratch area upfront, but the buffer is sized based on the original file size. The convert mechanism now allocates very minimum and reallocates as it receives the output from the clean filter process. * jh/resize-convert-scratch-buffer: convert: avoid malloc of original file size
-rw-r--r--convert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/convert.c b/convert.c
index 5d0307fc10..94ff837649 100644
--- a/convert.c
+++ b/convert.c
@@ -731,7 +731,7 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le
if (start_async(&async))
return 0; /* error was already reported */
- if (strbuf_read(&nbuf, async.out, len) < 0) {
+ if (strbuf_read(&nbuf, async.out, 0) < 0) {
err = error(_("read from external filter '%s' failed"), cmd);
}
if (close(async.out)) {