Don't scan uncompressed_objects_dir if it doesn't exist

A newly created archive-mode repository won't have a uncompressed-objects-cache
directory, and uncompressed_objects_dir is -1 to flag that. The special meaning of
-1 meaning "cwd" for libglnx means that the current directory was scanned as
if it was an objects directory, producing unexpected results, especially if there
were any two-letter files/subdirs in the current directory.

Closes: #1537
Approved by: jlebon
This commit is contained in:
Owen W. Taylor 2018-04-11 18:06:39 -04:00 committed by Atomic Bot
parent b9fc3eaa15
commit 9199237b01

View File

@ -1438,7 +1438,8 @@ scan_loose_devino (OstreeRepo *self,
return FALSE;
}
if (self->mode == OSTREE_REPO_MODE_ARCHIVE)
if (self->mode == OSTREE_REPO_MODE_ARCHIVE &&
self->uncompressed_objects_dir_fd != -1)
{
if (!scan_one_loose_devino (self, self->uncompressed_objects_dir_fd, devino_cache,
cancellable, error))