From 8f8ab56211802633d39a67f60b62535fd9a9b573 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 20 Apr 2016 15:33:44 +0200 Subject: [PATCH] repo: Allow loading files staged in the transaction Currently we can load metadata from the stage dir, but not file data, which makes no sense. Closes: #269 Approved by: cgwalters --- src/libostree/ostree-repo.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index f5c1b00a..3c37d342 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -3066,6 +3066,13 @@ ostree_repo_load_file (OstreeRepo *self, error)) goto out; + if (fd < 0 && self->commit_stagedir_fd != -1) + { + if (!ot_openat_ignore_enoent (self->commit_stagedir_fd, loose_path_buf, &fd, + error)) + goto out; + } + if (fd != -1) { tmp_stream = g_unix_input_stream_new (fd, TRUE);