static-delta: Ignore symlinks when computing similar objects

_ostree_delta_compute_similar_objects should not output symlinks.
Previously, a symlink in the "from" commit could be matched to a
real file in the "to" commit, since nothing was filtering symlinks
on the "from" side. This led to failures running the bzdiff
algorithm.
This commit is contained in:
John Hiesey 2015-08-25 18:15:53 -07:00 committed by Colin Walters
parent 4f57aa5b15
commit 43d045309c
1 changed files with 7 additions and 9 deletions

View File

@ -76,20 +76,18 @@ build_content_sizenames_recurse (OstreeRepo *repo,
{ {
g_autoptr(GFileInfo) finfo = NULL; g_autoptr(GFileInfo) finfo = NULL;
csizenames = g_new0 (OstreeDeltaContentSizeNames, 1);
csizenames->checksum = g_strdup (checksum);
/* Transfer ownership so things get cleaned up if we
* throw an exception below.
*/
g_hash_table_replace (sizenames_map, csizenames->checksum, csizenames);
if (!ostree_repo_load_file (repo, checksum, if (!ostree_repo_load_file (repo, checksum,
NULL, &finfo, NULL, NULL, &finfo, NULL,
cancellable, error)) cancellable, error))
goto out; goto out;
if (g_file_info_get_file_type (finfo) != G_FILE_TYPE_REGULAR)
continue;
csizenames = g_new0 (OstreeDeltaContentSizeNames, 1);
csizenames->checksum = g_strdup (checksum);
csizenames->size = g_file_info_get_size (finfo); csizenames->size = g_file_info_get_size (finfo);
g_hash_table_replace (sizenames_map, csizenames->checksum, csizenames);
} }
if (!csizenames->basenames) if (!csizenames->basenames)