Skip to content

Commit 1828e52

Browse files
committed
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
2 parents b582c16 + 02156ab commit 1828e52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

convert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le
731731
if (start_async(&async))
732732
return 0; /* error was already reported */
733733

734-
if (strbuf_read(&nbuf, async.out, len) < 0) {
734+
if (strbuf_read(&nbuf, async.out, 0) < 0) {
735735
err = error(_("read from external filter '%s' failed"), cmd);
736736
}
737737
if (close(async.out)) {

0 commit comments

Comments
 (0)