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 /include/git2/repository.h | |
| 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 'include/git2/repository.h')
| -rw-r--r-- | include/git2/repository.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index e3f687a29..04df25fd3 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -546,6 +546,10 @@ GIT_EXTERN(int) git_repository_mergehead_foreach( * hash a file in the repository and you want to apply filtering rules (e.g. * crlf filters) before generating the SHA, then use this function. * + * Note: if the repository has `core.safecrlf` set to fail and the + * filtering triggers that failure, then this function will return an + * error and not calculate the hash of the file. + * * @param out Output value of calculated SHA * @param repo Repository pointer * @param path Path to file on disk whose contents should be hashed. If the @@ -555,6 +559,7 @@ GIT_EXTERN(int) git_repository_mergehead_foreach( * NULL, then the `path` parameter will be used instead. If * this is passed as the empty string, then no filters will be * applied when calculating the hash. + * @return 0 on success, or an error code */ GIT_EXTERN(int) git_repository_hashfile( git_oid *out, |
