diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-12 14:31:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-20 18:46:58 -0700 |
commit | dd8e912190540ef6578386aa1343fbbe196cb8c1 (patch) | |
tree | f66b651a6c060a07a280d0d6aa73cd21c134b1e8 /cache.h | |
parent | streaming: a new API to read from the object store (diff) | |
download | tgif-dd8e912190540ef6578386aa1343fbbe196cb8c1.tar.xz |
streaming_write_entry(): use streaming API in write_entry()
When the output to a path does not have to be converted, we can read from
the object database from the streaming API and write to the file in the
working tree, without having to hold everything in the memory.
The ident, auto- and safe- crlf conversions inherently require you to read
the whole thing before deciding what to do, so while it is technically
possible to support them by using a buffer of an unbound size or rewinding
and reading the stream twice, it is less practical than the traditional
"read the whole thing in core and convert" approach.
Adding streaming filters for the other conversions on top of this should
be doable by tweaking the can_bypass_conversion() function (it should be
renamed to can_filter_stream() when it happens). Then the streaming API
can be extended to wrap the git_istream streaming_write_entry() opens on
the underlying object in another git_istream that reads from it, filters
what is read, and let the streaming_write_entry() read the filtered
result. But that is outside the scope of this series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1156,6 +1156,7 @@ extern int convert_to_git(const char *path, const char *src, size_t len, struct strbuf *dst, enum safe_crlf checksafe); extern int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst); extern int renormalize_buffer(const char *path, const char *src, size_t len, struct strbuf *dst); +extern int can_bypass_conversion(const char *path); /* add */ /* |