mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-03 17:47:40 +03:00
ostree/commit: Allow --orphan and --bind-ref to be specified together
Typically you’d use --branch and --bind-ref together to add additional bindings as well as creating a main --branch for the commit. However, you might also want to occasionally use --orphan --bind-ref to create a commit with bindings for one or more refs, but not actually create any of those refs pointing to the commit (you might create them as a later step). Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1347 Approved by: cgwalters
This commit is contained in:
parent
fb7692bd44
commit
5d1753f59b
@ -378,13 +378,11 @@ compare_strings (gconstpointer a, gconstpointer b)
|
||||
static void
|
||||
add_ref_binding (GVariantBuilder *metadata_builder)
|
||||
{
|
||||
if (opt_orphan)
|
||||
return;
|
||||
|
||||
g_assert_nonnull (opt_branch);
|
||||
g_assert (opt_branch != NULL || opt_orphan);
|
||||
|
||||
g_autoptr(GPtrArray) refs = g_ptr_array_new ();
|
||||
g_ptr_array_add (refs, opt_branch);
|
||||
if (opt_branch != NULL)
|
||||
g_ptr_array_add (refs, opt_branch);
|
||||
for (char **iter = opt_bind_refs; iter != NULL && *iter != NULL; ++iter)
|
||||
g_ptr_array_add (refs, *iter);
|
||||
g_ptr_array_sort (refs, compare_strings);
|
||||
|
Loading…
x
Reference in New Issue
Block a user