Blame SOURCES/0001-rebase-Support-identical-checksum-rebases.patch

377225
From 76ae779635afcd3984dedc57fa7c0e80c6410bba Mon Sep 17 00:00:00 2001
377225
From: Colin Walters <walters@verbum.org>
377225
Date: Fri, 29 Mar 2019 14:39:34 +0000
377225
Subject: [PATCH] rebase: Support identical checksum rebases
377225
377225
Change things to only throw this error for non-checksum rebases; for
377225
RHEL CoreOS + https://github.com/openshift/pivot/
377225
we've had it happen that the same ostree commit can end up
377225
in separate oscontainers.  We want to support changing
377225
the custom origin that might point to the same commit.
377225
---
377225
 src/daemon/rpmostreed-transaction-types.c | 12 +++++++++---
377225
 src/daemon/rpmostreed-utils.c             | 10 ----------
377225
 2 files changed, 9 insertions(+), 13 deletions(-)
377225
377225
diff --git a/src/daemon/rpmostreed-transaction-types.c b/src/daemon/rpmostreed-transaction-types.c
377225
index 9edfeecb..86112d1b 100644
377225
--- a/src/daemon/rpmostreed-transaction-types.c
377225
+++ b/src/daemon/rpmostreed-transaction-types.c
377225
@@ -100,9 +100,6 @@ change_origin_refspec (GVariantDict    *options,
377225
                                          error))
377225
     return FALSE;
377225
 
377225
-  if (strcmp (current_refspec, new_refspec) == 0)
377225
-    return glnx_throw (error, "Old and new refs are equal: %s", new_refspec);
377225
-
377225
   /* Re-classify after canonicalization to ensure we handle TYPE_CHECKSUM */
377225
   if (!rpmostree_refspec_classify (new_refspec, &refspectype, &refspecdata, error))
377225
     return FALSE;
377225
@@ -128,6 +125,15 @@ change_origin_refspec (GVariantDict    *options,
377225
     }
377225
   else
377225
     {
377225
+      /* We only throw this error for non-checksum rebases; for
377225
+       * RHEL CoreOS + https://github.com/openshift/pivot/
377225
+       * we've had it happen that the same ostree commit can end up
377225
+       * in separate oscontainers.  We want to support changing
377225
+       * the custom origin that might point to the same commit.
377225
+       */
377225
+      if (strcmp (current_refspec, new_refspec) == 0)
377225
+        return glnx_throw (error, "Old and new refs are equal: %s", new_refspec);
377225
+
377225
       if (!rpmostree_origin_set_rebase (origin, new_refspec, error))
377225
         return FALSE;
377225
     }
377225
diff --git a/src/daemon/rpmostreed-utils.c b/src/daemon/rpmostreed-utils.c
377225
index 686965a3..19b45a01 100644
377225
--- a/src/daemon/rpmostreed-utils.c
377225
+++ b/src/daemon/rpmostreed-utils.c
377225
@@ -202,16 +202,6 @@ rpmostreed_refspec_parse_partial (const gchar *new_provided_refspec,
377225
         }
377225
     }
377225
 
377225
-  if (g_strcmp0 (origin_remote, remote) == 0 &&
377225
-      g_strcmp0 (origin_ref, ref) == 0)
377225
-    {
377225
-      g_set_error (error, RPM_OSTREED_ERROR,
377225
-                   RPM_OSTREED_ERROR_INVALID_REFSPEC,
377225
-                   "Old and new refs are equal: %s:%s",
377225
-                   remote, ref);
377225
-      return FALSE;
377225
-    }
377225
-
377225
   if (remote == NULL)
377225
       *out_refspec = g_steal_pointer (&ref;;
377225
   else
377225
-- 
377225
2.20.1
377225