[ostree] upgrade: Properly set origin_refspec variable for resolve/printing



commit 0eb8c37ecb46bf190abf2a68203c851fd3b2b2a8
Author: Colin Walters <walters verbum org>
Date:   Wed Feb 26 15:12:46 2014 -0500

    upgrade: Properly set origin_refspec variable for resolve/printing
    
    1) We were ignoring the remote, which is broken
    2) We were printing NULL later on

 src/ostree/ot-admin-builtin-upgrade.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c
index 9fcae67..4139773 100644
--- a/src/ostree/ot-admin-builtin-upgrade.c
+++ b/src/ostree/ot-admin-builtin-upgrade.c
@@ -50,9 +50,9 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel
   gboolean ret = FALSE;
   GOptionContext *context;
   gs_unref_object OstreeRepo *repo = NULL;
-  gs_free char *origin_refspec = NULL;
   gs_free char *origin_remote = NULL;
   gs_free char *origin_ref = NULL;
+  gs_free char *origin_refspec = NULL;
   gs_free char *new_revision = NULL;
   gs_unref_object GFile *deployment_path = NULL;
   gs_unref_object GFile *deployment_origin_path = NULL;
@@ -98,12 +98,17 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel
       if (!ostree_repo_pull (repo, origin_remote, refs_to_fetch, pullflags, progress,
                              cancellable, error))
         goto out;
+      
+      origin_refspec = g_strconcat (origin_remote, ":", origin_ref, NULL);
     }
+  else
+    origin_refspec = g_strdup (origin_ref);
+
 
-  if (!ostree_repo_resolve_rev (repo, origin_ref, FALSE, &new_revision,
+  if (!ostree_repo_resolve_rev (repo, origin_refspec, FALSE, &new_revision,
                                 error))
     goto out;
-
+  
   if (strcmp (ostree_deployment_get_csum (merge_deployment), new_revision) == 0)
     {
       g_print ("Refspec %s is unchanged\n", origin_refspec);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]