summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-commit.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-08-23 09:37:44 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-08-23 14:48:12 +0000
commit556e2deb93e5af5a60e83da4bec5b218831a513f (patch)
treeea3074b9a0106fc1ab473d4472389cb8c3ee77fb /src/libostree/ostree-repo-commit.c
parent11fdca291950771858872386560e1103df1dda5f (diff)
downloadostree-556e2deb93e5af5a60e83da4bec5b218831a513f.tar.gz
lib/commit: Remove duplicated function for filter processing
The wrapping here is unnecessary, since `_ostree_repo_commit_modifier_apply()` already does what this function did. Further, the return type was wrong. Saw this while doing some libarchive work. Closes: #1104 Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-repo-commit.c')
-rw-r--r--src/libostree/ostree-repo-commit.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
index 1c6e5e8d..dd63bf1a 100644
--- a/src/libostree/ostree-repo-commit.c
+++ b/src/libostree/ostree-repo-commit.c
@@ -2335,6 +2335,10 @@ create_tree_variant_from_hashes (GHashTable *file_checksums,
return serialized_tree;
}
+/* If any filtering is set up, perform it, and return modified file info in
+ * @out_modified_info. Note that if no filtering is applied, @out_modified_info
+ * will simply be another reference (with incremented refcount) to @file_info.
+ */
OstreeRepoCommitFilterResult
_ostree_repo_commit_modifier_apply (OstreeRepo *self,
OstreeRepoCommitModifier *modifier,
@@ -2411,24 +2415,6 @@ ptrarray_path_join (GPtrArray *path)
}
static gboolean
-apply_commit_filter (OstreeRepo *self,
- OstreeRepoCommitModifier *modifier,
- const char *relpath,
- GFileInfo *file_info,
- GFileInfo **out_modified_info)
-{
- if (modifier == NULL ||
- (modifier->filter == NULL &&
- (modifier->flags & OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS) == 0))
- {
- *out_modified_info = g_object_ref (file_info);
- return OSTREE_REPO_COMMIT_FILTER_ALLOW;
- }
-
- return _ostree_repo_commit_modifier_apply (self, modifier, relpath, file_info, out_modified_info);
-}
-
-static gboolean
get_modified_xattrs (OstreeRepo *self,
OstreeRepoCommitModifier *modifier,
const char *relpath,
@@ -2564,7 +2550,7 @@ write_directory_content_to_mtree_internal (OstreeRepo *self,
if (modifier != NULL)
child_relpath = ptrarray_path_join (path);
- filter_result = apply_commit_filter (self, modifier, child_relpath, child_info, &modified_info);
+ filter_result = _ostree_repo_commit_modifier_apply (self, modifier, child_relpath, child_info, &modified_info);
if (filter_result != OSTREE_REPO_COMMIT_FILTER_ALLOW)
{
@@ -2733,7 +2719,7 @@ write_directory_to_mtree_internal (OstreeRepo *self,
relpath = ptrarray_path_join (path);
g_autoptr(GFileInfo) modified_info = NULL;
- filter_result = apply_commit_filter (self, modifier, relpath, child_info, &modified_info);
+ filter_result = _ostree_repo_commit_modifier_apply (self, modifier, relpath, child_info, &modified_info);
if (filter_result == OSTREE_REPO_COMMIT_FILTER_ALLOW)
{
@@ -2812,7 +2798,7 @@ write_dfd_iter_to_mtree_internal (OstreeRepo *self,
{
relpath = ptrarray_path_join (path);
- filter_result = apply_commit_filter (self, modifier, relpath, child_info, &modified_info);
+ filter_result = _ostree_repo_commit_modifier_apply (self, modifier, relpath, child_info, &modified_info);
}
else
{