Skip to content

Commit dfd9a63

Browse files
authored
Merge pull request #3569 from lxnay/main
status: Include deployment origin refspec as refspec in JSON output
2 parents 0660e83 + 67774c4 commit dfd9a63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ostree/ot-admin-builtin-status.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,16 @@ deployment_write_json (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeploymen
197197
gboolean is_booted, gboolean is_pending, gboolean is_rollback,
198198
struct ul_jsonwrt *jo, GCancellable *cancellable, GError **error)
199199
{
200+
GKeyFile *origin = ostree_deployment_get_origin (deployment);
201+
g_autofree char *origin_refspec
202+
= origin ? g_key_file_get_string (origin, "origin", "refspec", NULL) : NULL;
203+
200204
ul_jsonwrt_object_open (jo, NULL);
201205

202206
const char *ref = ostree_deployment_get_csum (deployment);
203207
ul_jsonwrt_value_s (jo, "checksum", ref);
204208
ul_jsonwrt_value_s (jo, "stateroot", ostree_deployment_get_osname (deployment));
209+
ul_jsonwrt_value_s (jo, "refspec", origin_refspec);
205210
ul_jsonwrt_value_u64 (jo, "serial", ostree_deployment_get_deployserial (deployment));
206211
ul_jsonwrt_value_u64 (jo, "index", ostree_deployment_get_index (deployment));
207212
ul_jsonwrt_value_boolean (jo, "booted", is_booted);

0 commit comments

Comments
 (0)