diff options
author | Russell Belfer <rb@github.com> | 2012-09-05 15:00:40 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-09-06 15:34:02 -0700 |
commit | 60b9d3fcef04a6beb0ad4df225ada058afabf0b9 (patch) | |
tree | efc9e427753619d29d1df56b0ea97446f1a3f9d9 /src/diff.h | |
parent | 8f9b6a132b358b23b518197240184e2f08e0a913 (diff) | |
download | libgit2-60b9d3fcef04a6beb0ad4df225ada058afabf0b9.tar.gz |
Implement filters for status/diff blobs
This adds support to diff and status for running filters (a la crlf)
on blobs in the workdir before computing SHAs and before generating
text diffs. This ended up being a bit more code change than I had
thought since I had to reorganize some of the diff logic to minimize
peak memory use when filtering blobs in a diff.
This also adds a cap on the maximum size of data that will be loaded
to diff. I set it at 512Mb which should match core git. Right now
it is a #define in src/diff.h but it could be moved into the public
API if desired.
Diffstat (limited to 'src/diff.h')
-rw-r--r-- | src/diff.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/diff.h b/src/diff.h index 2785fa425..def746323 100644 --- a/src/diff.h +++ b/src/diff.h @@ -25,6 +25,8 @@ enum { GIT_DIFFCAPS_USE_DEV = (1 << 4), /* use st_dev? */ }; +#define MAX_DIFF_FILESIZE 0x20000000 + struct git_diff_list { git_refcount rc; git_repository *repo; |