commit-from: Add --force support

This commit is contained in:
Alexander Larsson
2016-11-30 18:08:50 +01:00
parent 21b65947e8
commit cc7402d6f7
2 changed files with 11 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ static char *opt_body;
static gboolean opt_update_appstream;
static gboolean opt_no_update_summary;
static gboolean opt_untrusted;
static gboolean opt_force;
static char **opt_gpg_key_ids;
static char *opt_gpg_homedir;
@@ -46,6 +47,7 @@ static GOptionEntry options[] = {
{ "src-repo", 's', 0, G_OPTION_ARG_STRING, &opt_src_repo, N_("Source repo dir"), N_("SRC-REPO") },
{ "src-ref", 's', 0, G_OPTION_ARG_STRING, &opt_src_ref, N_("Source repo ref"), N_("SRC-REF") },
{ "untrusted", 0, 0, G_OPTION_ARG_NONE, &opt_untrusted, "Do not trust SRC-REPO", NULL },
{ "force", 0, 0, G_OPTION_ARG_NONE, &opt_force, "Always commit, even if same content", NULL },
{ "subject", 's', 0, G_OPTION_ARG_STRING, &opt_subject, N_("One line subject"), N_("SUBJECT") },
{ "body", 'b', 0, G_OPTION_ARG_STRING, &opt_body, N_("Full description"), N_("BODY") },
{ "update-appstream", 0, 0, G_OPTION_ARG_NONE, &opt_update_appstream, N_("Update the appstream branch"), NULL },
@@ -247,7 +249,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
return flatpak_fail (error, _("Can't commit from partial source commit."));
/* Don't create a new commit if this is the same tree */
if (dst_parent_root != NULL && g_file_equal (dst_parent_root, src_ref_root))
if (!opt_force && dst_parent_root != NULL && g_file_equal (dst_parent_root, src_ref_root))
{
g_print ("%s: no change\n", dst_ref);
continue;

View File

@@ -139,6 +139,14 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--force</option></term>
<listitem><para>
Create new commit even if the content didn't change from the existing branch head.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--gpg-sign=KEYID</option></term>