diff --git a/src/libostree/ostree-repo-libarchive.c b/src/libostree/ostree-repo-libarchive.c index 1839a088..8d9e8969 100644 --- a/src/libostree/ostree-repo-libarchive.c +++ b/src/libostree/ostree-repo-libarchive.c @@ -861,7 +861,11 @@ ostree_repo_import_archive_to_mtree (OstreeRepo *self, g_file_info_set_attribute_uint32 (fi, "unix::gid", 0); g_file_info_set_attribute_uint32 (fi, "unix::mode", DEFAULT_DIRMODE); - if (!aic_ensure_parent_dir_with_file_info (&aictx, mtree, "/", fi, NULL, + g_autoptr(GFileInfo) mfi = NULL; + (void)_ostree_repo_commit_modifier_apply (self, modifier, "/", + fi, &mfi); + + if (!aic_ensure_parent_dir_with_file_info (&aictx, mtree, "/", mfi, NULL, cancellable, error)) goto out; } diff --git a/tests/test-libarchive.sh b/tests/test-libarchive.sh index 6540b94b..6653fa6a 100755 --- a/tests/test-libarchive.sh +++ b/tests/test-libarchive.sh @@ -26,7 +26,7 @@ fi . $(dirname $0)/libtest.sh -echo "1..20" +echo "1..21" setup_test_repository "bare" @@ -154,3 +154,13 @@ $OSTREE checkout partial partial-checkout cd partial-checkout assert_file_has_content subdir/original "original" echo "ok tar partial commit contents" + +cd ${test_tmpdir} +tar -cf empty.tar.gz -T /dev/null +uid=$(id -u) +gid=$(id -g) +$OSTREE commit -b tar-empty --tar-autocreate-parents \ + --owner-uid=${uid} --owner-gid=${gid} --tree=tar=empty.tar.gz +$OSTREE ls tar-empty > ls.txt +assert_file_has_content ls.txt "d00755 ${uid} ${gid} 0 /" +echo "ok tar autocreate with owner uid/gid"