/** * Imports posts from a given tree sha */ public function import_tree($sha) { $tree = $this->api->get_tree_recursive($sha); if (is_wp_error($tree)) { WordPress_GitHub_Sync::write_log(__('Failed getting recursive tree with error: ', WordPress_GitHub_Sync::$text_domain) . $tree->get_error_message()); return; } foreach ($tree as $blob) { $this->import_blob($blob); } WordPress_GitHub_Sync::write_log(__('Imported tree ', WordPress_GitHub_Sync::$text_domain) . $sha); }
/** * Fetch the tree for the provided sha from the repository. * * @param $sha */ public function fetch_sha($sha) { $this->tree = $this->api->get_tree_recursive($sha); }