core: Only do devino scan on commit (speeds up pull)

When fetching data remotely, there's no point to the devino scan
because we're not going to be committing local files.

Only do it for "commit".
This commit is contained in:
Colin Walters committed 2012-10-05 17:12:39 -04:00
1 parent efe27f1b05
commit 52a0b7bdb1
5 files changed
+11 -8

No files matched your search

+7 -5
View File
@@ -1276,6 +1276,7 @@ devino_cache_lookup (OstreeRepo *self,
gboolean
ostree_repo_prepare_transaction (OstreeRepo *self,
gboolean enable_commit_hardlink_scan,
GCancellable *cancellable,
GError **error)
{
@@ -1285,13 +1286,14 @@ ostree_repo_prepare_transaction (OstreeRepo *self,
self->in_transaction = TRUE;
if (!self->loose_object_devino_hash)
if (enable_commit_hardlink_scan)
{
self->loose_object_devino_hash = g_hash_table_new_full (devino_hash, devino_equal, g_free, g_free);
if (!self->loose_object_devino_hash)
self->loose_object_devino_hash = g_hash_table_new_full (devino_hash, devino_equal, g_free, g_free);
g_hash_table_remove_all (self->loose_object_devino_hash);
if (!scan_loose_devino (self, self->loose_object_devino_hash, cancellable, error))
goto out;
}
g_hash_table_remove_all (self->loose_object_devino_hash);
if (!scan_loose_devino (self, self->loose_object_devino_hash, cancellable, error))
goto out;
ret = TRUE;
out:
+1
View File
@@ -77,6 +77,7 @@ GFile * ostree_repo_get_file_object_path (OstreeRepo *self,
const char *object);
gboolean ostree_repo_prepare_transaction (OstreeRepo *self,
gboolean enable_commit_hardlink_scan,
GCancellable *cancellable,
GError **error);