diff options
author | Russell Belfer <rb@github.com> | 2014-05-06 16:01:49 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-06 16:01:49 -0700 |
commit | 5269008cf632efcd6a16f6160ec44244ce442400 (patch) | |
tree | ad3be5bcf12e9c046fab24fac3063e22b6843d5c /src/blob.c | |
parent | 6e9afb97d14545f9cea292f581de89d610ae8c07 (diff) | |
download | libgit2-5269008cf632efcd6a16f6160ec44244ce442400.tar.gz |
Add filter options and ALLOW_UNSAFE
Diff and status do not want core.safecrlf to actually raise an
error regardless of the setting, so this extends the filter API
with an additional options flags parameter and adds a flag so that
filters can be applied with GIT_FILTER_OPT_ALLOW_UNSAFE, indicating
that unsafe filter application should be downgraded from a failure
to a warning.
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/blob.c b/src/blob.c index 0aa2516db..ab7dec67f 100644 --- a/src/blob.c +++ b/src/blob.c @@ -198,7 +198,8 @@ int git_blob__create_from_paths( if (try_load_filters) /* Load the filters for writing this file to the ODB */ error = git_filter_list_load( - &fl, repo, NULL, hint_path, GIT_FILTER_TO_ODB); + &fl, repo, NULL, hint_path, + GIT_FILTER_TO_ODB, GIT_FILTER_OPT_DEFAULT); if (error < 0) /* well, that didn't work */; @@ -356,7 +357,8 @@ int git_blob_filtered_content( return 0; if (!(error = git_filter_list_load( - &fl, git_blob_owner(blob), blob, path, GIT_FILTER_TO_WORKTREE))) { + &fl, git_blob_owner(blob), blob, path, + GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT))) { error = git_filter_list_apply_to_blob(out, fl, blob); |