lib/diff: ignore xattrs if disabled on either repos

This fixes the logic to detect whether xattrs should be automatically
ignored when diffing.
This commit is contained in:
Luca BRUNO 2021-08-23 12:39:02 +00:00
parent 2f675cf1b1
commit 06ff77cfeb
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E
1 changed files with 11 additions and 8 deletions

View File

@ -268,15 +268,18 @@ ostree_diff_dirs_with_options (OstreeDiffFlags flags,
/* If we're diffing versus a repo, and either of them have xattrs disabled, /* If we're diffing versus a repo, and either of them have xattrs disabled,
* then disable for both. * then disable for both.
*/ */
OstreeRepo *repo;
if (OSTREE_IS_REPO_FILE (a)) if (OSTREE_IS_REPO_FILE (a))
repo = ostree_repo_file_get_repo ((OstreeRepoFile*)a); {
else if (OSTREE_IS_REPO_FILE (b)) OstreeRepo *repo = ostree_repo_file_get_repo ((OstreeRepoFile*)a);
repo = ostree_repo_file_get_repo ((OstreeRepoFile*)b); if (repo->disable_xattrs)
else flags |= OSTREE_DIFF_FLAGS_IGNORE_XATTRS;
repo = NULL; }
if (repo != NULL && repo->disable_xattrs) if (OSTREE_IS_REPO_FILE (b))
flags |= OSTREE_DIFF_FLAGS_IGNORE_XATTRS; {
OstreeRepo *repo = ostree_repo_file_get_repo ((OstreeRepoFile*)b);
if (repo->disable_xattrs)
flags |= OSTREE_DIFF_FLAGS_IGNORE_XATTRS;
}
if (a == NULL) if (a == NULL)
{ {