Skip to content

Commit

Permalink
Merge pull request #3322 from cgwalters/tweak-commit-assertion
Browse files Browse the repository at this point in the history
commit: Give a better error message for unhandled file type
  • Loading branch information
dbnicholson authored Oct 10, 2024
2 parents a54518e + f11e6a4 commit 6dc8b87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libostree/ostree-repo-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,8 @@ _ostree_repo_commit_modifier_apply (OstreeRepo *self, OstreeRepoCommitModifier *
if (canonicalize_perms)
{
guint mode = g_file_info_get_attribute_uint32 (modified_info, "unix::mode");
switch (g_file_info_get_file_type (file_info))
GFileType ty = g_file_info_get_file_type (file_info);
switch (ty)
{
case G_FILE_TYPE_REGULAR:
/* In particular, we want to squash the s{ug}id bits, but this also
Expand All @@ -3188,7 +3189,7 @@ _ostree_repo_commit_modifier_apply (OstreeRepo *self, OstreeRepoCommitModifier *
case G_FILE_TYPE_SYMBOLIC_LINK:
break;
default:
g_assert_not_reached ();
g_error ("unexpected file type %u", (unsigned)ty);
}
g_file_info_set_attribute_uint32 (modified_info, "unix::uid", 0);
g_file_info_set_attribute_uint32 (modified_info, "unix::gid", 0);
Expand Down

0 comments on commit 6dc8b87

Please sign in to comment.