<div><tableclass="navigation"id="top"width="100%"cellpadding="2"cellspacing="0"><tr><thvalign="middle"><pclass="title">OSTree API references</p></th></tr></table></div>
<p>In many cases using libostree, a program may need to "break"
hardlinks by performing a copy. For example, in order to
logically append to a file.</p>
<p>This function performs full copying, including e.g. extended
attributes and permissions of both regular files and symbolic links.</p>
<p>If the file is not hardlinked, this function does nothing and
returns successfully.</p>
<p>This function does not perform synchronization via <codeclass="literal"><codeclass="function">fsync()</code></code> or
<codeclass="literal"><codeclass="function">fdatasync()</code></code>; the idea is this will commonly be done as part
of an <codeclass="literal"><aclass="link"href="ostree-OstreeRepo.html#ostree-repo-commit-transaction"title="ostree_repo_commit_transaction()"><codeclass="function">ostree_repo_commit_transaction()</code></a></code>, which itself takes
@@ -2644,6 +2660,7 @@ entire objects directory. If your commit is composed of mostly hardlinks to
existing ostree objects, then this will speed up considerably, so call it
before you call <codeclass="function">ostree_write_directory_to_mtree()</code> or similar. However,
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-devino-cache-new"title="ostree_repo_devino_cache_new()"><codeclass="function">ostree_repo_devino_cache_new()</code></a> is better as it avoids scanning all objects.</p>
<p>Multithreading: This function is *not* MT safe.</p>
@@ -2684,8 +2701,17 @@ ostree_repo_prepare_transaction (<em class="parameter"><code><a class="link" hre
need to start a transaction. You can complete the transaction with
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-commit-transaction"title="ostree_repo_commit_transaction()"><codeclass="function">ostree_repo_commit_transaction()</code></a>, or abort the transaction with
<p>Currently, transactions are not atomic, and aborting a transaction
will not erase any data you write during the transaction.</p>
<p>Currently, transactions may result in partial commits or data in the target
repository if interrupted during <aclass="link"href="ostree-OstreeRepo.html#ostree-repo-commit-transaction"title="ostree_repo_commit_transaction()"><codeclass="function">ostree_repo_commit_transaction()</code></a>, and
further writing refs is also not currently atomic.</p>
<p>There can be at most one transaction active on a repo at a time per instance
of <codeclass="literal">OstreeRepo</code>; however, it is safe to have multiple threads writing objects
on a single <codeclass="literal">OstreeRepo</code> instance as long as their lifetime is bounded by the
transaction.</p>
<p>Multithreading: This function is *not* MT safe; only one transaction can be
active at a time.</p>
<p>This function takes a shared lock on the <emclass="parameter"><code>self</code></em>
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-transaction-set-ref"title="ostree_repo_transaction_set_ref()"><codeclass="function">ostree_repo_transaction_set_ref()</code></a> or
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-transaction-set-refspec"title="ostree_repo_transaction_set_refspec()"><codeclass="function">ostree_repo_transaction_set_refspec()</code></a> will be written out.</p>
<p>Note that if multiple threads are performing writes, all such threads must
have terminated before this function is invoked.</p>
<p>Multithreading: This function is *not* MT safe; only one transaction can be
<p>Otherwise, if <emclass="parameter"><code>checksum</code></em>
is <codeclass="literal">NULL</code>, then record that the ref should
be deleted.</p>
<p>The change will not be written out immediately, but when the transaction
is completed with <aclass="link"href="ostree-OstreeRepo.html#ostree-repo-commit-transaction"title="ostree_repo_commit_transaction()"><codeclass="function">ostree_repo_commit_transaction()</code></a>. If the transaction
is instead aborted with <aclass="link"href="ostree-OstreeRepo.html#ostree-repo-abort-transaction"title="ostree_repo_abort_transaction()"><codeclass="function">ostree_repo_abort_transaction()</code></a>, no changes will
be made to the repository.</p>
<p>The change will be written when the transaction is completed with
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-commit-transaction"title="ostree_repo_commit_transaction()"><codeclass="function">ostree_repo_commit_transaction()</code></a>; that function takes care of writing all of
the objects (such as the commit referred to by <emclass="parameter"><code>checksum</code></em>
) before updating the
refs. If the transaction is instead aborted with
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-abort-transaction"title="ostree_repo_abort_transaction()"><codeclass="function">ostree_repo_abort_transaction()</code></a>, no changes to the ref will be made to the
repository.</p>
<p>Note however that currently writing *multiple* refs is not truly atomic; if
the process or system is terminated during
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-commit-transaction"title="ostree_repo_commit_transaction()"><codeclass="function">ostree_repo_commit_transaction()</code></a>, it is possible that just some of the refs
will have been updated. Your application should take care to handle this
case.</p>
<p>Multithreading: Since v2017.15 this function is MT safe.</p>
<p>This is like <aclass="link"href="ostree-OstreeRepo.html#ostree-repo-transaction-set-ref"title="ostree_repo_transaction_set_ref()"><codeclass="function">ostree_repo_transaction_set_ref()</code></a>, except it may be
invoked outside of a transaction. This is presently safe for the
case where we're creating or overwriting an existing ref.</p>
<p>Commits in "partial" state do not have all their child objects written. This
occurs in various situations, such as during a pull, but also if a "subpath"
pull is used, as well as "commit only" pulls.</p>
<p>This function is used by <aclass="link"href="ostree-OstreeRepo.html#ostree-repo-pull-with-options"title="ostree_repo_pull_with_options()"><codeclass="function">ostree_repo_pull_with_options()</code></a>; you
should use this if you are implementing a different type of transport.</p>
with their current values in <emclass="parameter"><code>out_all_refs</code></em>
. Otherwise, only list
refspecs which have <emclass="parameter"><code>refspec_prefix</code></em>
as a prefix. Differently from
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-list-refs"title="ostree_repo_list_refs()"><codeclass="function">ostree_repo_list_refs()</code></a>, the prefix will not be removed from the ref
will be returned as a mapping from refspecs (including the
remote name) to checksums. Differently from <aclass="link"href="ostree-OstreeRepo.html#ostree-repo-list-refs"title="ostree_repo_list_refs()"><codeclass="function">ostree_repo_list_refs()</code></a>, the
@@ -6436,6 +6583,8 @@ history from the repository.</p>
<p>Use the <aclass="link"href="ostree-OstreeRepo.html#OSTREE-REPO-PRUNE-FLAGS-NO-PRUNE:CAPS"><codeclass="literal">OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE</code></a> to just determine
statistics on objects that would be deleted, without actually
deleting them.</p>
<p>This function takes an exclusive lock on the <emclass="parameter"><code>self</code></em>
@@ -6554,6 +6705,8 @@ retain all commits from a production branch, but just GC some history from
your dev branch.</p>
<p>The <aclass="link"href="ostree-OstreeRepo.html#OSTREE-REPO-PRUNE-FLAGS-NO-PRUNE:CAPS"><codeclass="literal">OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE</code></a> flag may be specified to just determine
statistics on objects that would be deleted, without actually deleting them.</p>
<p>This function takes an exclusive lock on the <emclass="parameter"><code>self</code></em>
<aclass="link"href="ostree-ostree-bootconfig-parser.html#ostree-bootconfig-parser-write-at"title="ostree_bootconfig_parser_write_at()">ostree_bootconfig_parser_write_at</a>, function in <aclass="link"href="ostree-ostree-bootconfig-parser.html"title="ostree-bootconfig-parser">ostree-bootconfig-parser</a>
</dt>
<dd></dd>
<dt>
<aclass="link"href="ostree-Core-repository-independent-functions.html#ostree-break-hardlink"title="ostree_break_hardlink()">ostree_break_hardlink</a>, function in <aclass="link"href="ostree-Core-repository-independent-functions.html"title="Core repository-independent functions">Core repository-independent functions</a>
</dt>
<dd></dd>
<aname="idxC"></a><h3class="title">C</h3>
<dt>
<aclass="link"href="ostree-ostree-chain-input-stream.html#OstreeChainInputStream"title="struct OstreeChainInputStream">OstreeChainInputStream</a>, struct in <aclass="link"href="ostree-ostree-chain-input-stream.html"title="ostree-chain-input-stream">ostree-chain-input-stream</a>
@@ -858,6 +862,10 @@ OSTREE_RELEASE_VERSION, macro in ostree-version
</dt>
<dd></dd>
<dt>
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-fsck-object"title="ostree_repo_fsck_object()">ostree_repo_fsck_object</a>, function in <aclass="link"href="ostree-OstreeRepo.html"title="OstreeRepo: Content-addressed object store">OstreeRepo</a>
</dt>
<dd></dd>
<dt>
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-get-config"title="ostree_repo_get_config()">ostree_repo_get_config</a>, function in <aclass="link"href="ostree-OstreeRepo.html"title="OstreeRepo: Content-addressed object store">OstreeRepo</a>
</dt>
<dd></dd>
@@ -970,6 +978,10 @@ OSTREE_RELEASE_VERSION, macro in ostree-version
</dt>
<dd></dd>
<dt>
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-mark-commit-partial"title="ostree_repo_mark_commit_partial()">ostree_repo_mark_commit_partial</a>, function in <aclass="link"href="ostree-OstreeRepo.html"title="OstreeRepo: Content-addressed object store">OstreeRepo</a>
</dt>
<dd></dd>
<dt>
<aclass="link"href="ostree-OstreeRepo.html#ostree-repo-mode-from-string"title="ostree_repo_mode_from_string()">ostree_repo_mode_from_string</a>, function in <aclass="link"href="ostree-OstreeRepo.html"title="OstreeRepo: Content-addressed object store">OstreeRepo</a>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.