diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-07-21 14:15:12 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-08-11 20:47:59 +0100 |
| commit | fba3bf79780406cad976086cbba8b9684073ba9d (patch) | |
| tree | 5b30d7aff192c77057cb58d9b2434ee06d4b120d /src/blob.c | |
| parent | f0f27c1c2b2bf875a6d86c24f8564580732f55c6 (diff) | |
| download | libgit2-fba3bf79780406cad976086cbba8b9684073ba9d.tar.gz | |
blob: optionally read attributes from repository
When `GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD` is passed to
`git_blob_filter`, read attributes from `gitattributes` files that
are checked in to the repository at the HEAD revision. This passes
the flag `GIT_FILTER_ATTRIBUTES_FROM_HEAD` to the filter functions.
Diffstat (limited to 'src/blob.c')
| -rw-r--r-- | src/blob.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c index 7db05f046..487e608b7 100644 --- a/src/blob.c +++ b/src/blob.c @@ -428,6 +428,9 @@ int git_blob_filter( if ((opts.flags & GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES) != 0) flags |= GIT_FILTER_NO_SYSTEM_ATTRIBUTES; + if ((opts.flags & GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD) != 0) + flags |= GIT_FILTER_ATTRIBUTES_FROM_HEAD; + if (!(error = git_filter_list_load( &fl, git_blob_owner(blob), blob, path, GIT_FILTER_TO_WORKTREE, flags))) { |
