diff options
author | Colin Walters <walters@verbum.org> | 2014-02-26 15:12:46 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2014-02-26 15:13:12 -0500 |
commit | 0eb8c37ecb46bf190abf2a68203c851fd3b2b2a8 (patch) | |
tree | 49be719ca23211fa5816c30e071181dc407a65fc /src/ostree/ot-admin-builtin-upgrade.c | |
parent | c85682cb8534ecac6d2064c25ac0abbd4402d2a8 (diff) | |
download | ostree-0eb8c37ecb46bf190abf2a68203c851fd3b2b2a8.tar.gz |
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
Diffstat (limited to 'src/ostree/ot-admin-builtin-upgrade.c')
-rw-r--r-- | 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 9fcae678..41397739 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); |