summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-09-17 09:57:55 -0700
committerVicent Martí <vicent@github.com>2013-09-17 09:57:55 -0700
commitbb371b62e950e3307d3acf2f772495a60565d266 (patch)
treeb4479ec3ad261bcac13493ee3f5ad45d15dfdda2 /src/repository.c
parent4581f9d8ab72e9b97817e1eaa7154bcec1c7f0b1 (diff)
parentf60ed4e6495b8bf68d0604335672e6f300330b3b (diff)
downloadlibgit2-bb371b62e950e3307d3acf2f772495a60565d266.tar.gz
Merge pull request #1847 from libgit2/filters-alternative
Alternative proposal for filter API
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/repository.c b/src/repository.c
index eead41201..76e8228b7 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1649,7 +1649,7 @@ int git_repository_hashfile(
const char *as_path)
{
int error;
- git_vector filters = GIT_VECTOR_INIT;
+ git_filter_list *fl = NULL;
git_file fd = -1;
git_off_t len;
git_buf full_path = GIT_BUF_INIT;
@@ -1671,7 +1671,8 @@ int git_repository_hashfile(
/* passing empty string for "as_path" indicated --no-filters */
if (strlen(as_path) > 0) {
- error = git_filters_load(&filters, repo, as_path, GIT_FILTER_TO_ODB);
+ error = git_filter_list_load(
+ &fl, repo, NULL, as_path, GIT_FILTER_TO_ODB);
if (error < 0)
return error;
} else {
@@ -1698,12 +1699,12 @@ int git_repository_hashfile(
goto cleanup;
}
- error = git_odb__hashfd_filtered(out, fd, (size_t)len, type, &filters);
+ error = git_odb__hashfd_filtered(out, fd, (size_t)len, type, fl);
cleanup:
if (fd >= 0)
p_close(fd);
- git_filters_free(&filters);
+ git_filter_list_free(fl);
git_buf_free(&full_path);
return error;