summaryrefslogtreecommitdiff
path: root/src/odb.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-09-05 15:00:40 -0700
committerRussell Belfer <rb@github.com>2012-09-06 15:34:02 -0700
commit60b9d3fcef04a6beb0ad4df225ada058afabf0b9 (patch)
treeefc9e427753619d29d1df56b0ea97446f1a3f9d9 /src/odb.h
parent8f9b6a132b358b23b518197240184e2f08e0a913 (diff)
downloadlibgit2-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/odb.h')
-rw-r--r--src/odb.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/odb.h b/src/odb.h
index 263e4c30b..696e12943 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -58,12 +58,19 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj);
int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type);
/*
- * Hash a `path`, assuming it could be a POSIX symlink: if the path is a symlink,
- * then the raw contents of the symlink will be hashed. Otherwise, this will
- * fallback to `git_odb__hashfd`.
+ * Hash an open file descriptor applying an array of filters
+ * Acts just like git_odb__hashfd with the addition of filters...
+ */
+int git_odb__hashfd_filtered(
+ git_oid *out, git_file fd, size_t len, git_otype type, git_vector *filters);
+
+/*
+ * Hash a `path`, assuming it could be a POSIX symlink: if the path is a
+ * symlink, then the raw contents of the symlink will be hashed. Otherwise,
+ * this will fallback to `git_odb__hashfd`.
*
- * The hash type for this call is always `GIT_OBJ_BLOB` because symlinks may only
- * point to blobs.
+ * The hash type for this call is always `GIT_OBJ_BLOB` because symlinks may
+ * only point to blobs.
*/
int git_odb__hashlink(git_oid *out, const char *path);