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
This commit is contained in:
Alexander Larsson 2016-04-20 15:33:44 +02:00 committed by Colin Walters (automation)
parent bd3ad8cc5c
commit 8f8ab56211
1 changed files with 7 additions and 0 deletions

View File

@ -3066,6 +3066,13 @@ ostree_repo_load_file (OstreeRepo *self,
error)) error))
goto out; 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) if (fd != -1)
{ {
tmp_stream = g_unix_input_stream_new (fd, TRUE); tmp_stream = g_unix_input_stream_new (fd, TRUE);