Skip to content

Commit

Permalink
checkout: Dedup calls to memcache ref
Browse files Browse the repository at this point in the history
Minor, but I realized `checkout_tree_at()` is a better place to
do common setup before checkout.  Prep for
#813

Closes: #823
Approved by: jlebon
  • Loading branch information
cgwalters authored and rh-atomic-bot committed May 1, 2017
1 parent dae6cfb commit 8d8f06f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libostree/ostree-repo-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,11 @@ checkout_tree_at (OstreeRepo *self,
g_assert (options->force_copy);
}

/* Cache any directory metadata we read during this operation;
* see commit b7afe91e21143d7abb0adde440683a52712aa246
*/
g_auto(OstreeRepoMemoryCacheRef) memcache_ref;
_ostree_repo_memory_cache_ref_init (&memcache_ref, self);
return checkout_tree_at_recurse (self, options, &state, destination_parent_fd,
destination_name,
source, source_info,
Expand Down Expand Up @@ -829,8 +834,6 @@ ostree_repo_checkout_tree (OstreeRepo *self,
options.enable_uncompressed_cache = TRUE;
canonicalize_options (self, &options);

g_auto(OstreeRepoMemoryCacheRef) memcache_ref;
_ostree_repo_memory_cache_ref_init (&memcache_ref, self);
return checkout_tree_at (self, &options,
AT_FDCWD, gs_file_get_path_cached (destination),
source, source_info,
Expand Down Expand Up @@ -948,8 +951,6 @@ ostree_repo_checkout_at (OstreeRepo *self,
if (!target_info)
return FALSE;

g_auto(OstreeRepoMemoryCacheRef) memcache_ref;
_ostree_repo_memory_cache_ref_init (&memcache_ref, self);
if (!checkout_tree_at (self, options,
destination_dfd,
destination_path,
Expand Down

0 comments on commit 8d8f06f

Please sign in to comment.