summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-07-21 12:13:07 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2019-08-11 20:47:59 +0100
commita5392eae3d40dc7789de581406e35a1ce7487e1e (patch)
treee828d9e3207ee334361918bac58b7e705d9441b9 /src/blob.c
parent22eb12afef4785fac47d56e2e8a13c840294ca4a (diff)
downloadlibgit2-a5392eae3d40dc7789de581406e35a1ce7487e1e.tar.gz
blob: allow blob filtering to ignore system gitattributes
Introduce `GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES`, which tells `git_blob_filter` to ignore the system-wide attributes file, usually `/etc/gitattributes`. This simply passes the appropriate flag to the attribute loading code.
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c
index 1af3131ba..7db05f046 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -425,6 +425,9 @@ int git_blob_filter(
git_blob_is_binary(blob))
return 0;
+ if ((opts.flags & GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES) != 0)
+ flags |= GIT_FILTER_NO_SYSTEM_ATTRIBUTES;
+
if (!(error = git_filter_list_load(
&fl, git_blob_owner(blob), blob, path,
GIT_FILTER_TO_WORKTREE, flags))) {