From 91bb76cc7a7d818f2e92f843ab4ab510c0662ae0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 9 Oct 2024 11:14:27 +0200 Subject: [PATCH] fixup! status: add status serialization mechanism We must ensure that the path to the index file is available when validating the index. This fixes t7522.{2,3,4,5,7,8,9,10,11,12,13}. Signed-off-by: Johannes Schindelin --- wt-status-deserialize.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wt-status-deserialize.c b/wt-status-deserialize.c index 39c2673358b218..1e851afec4616b 100644 --- a/wt-status-deserialize.c +++ b/wt-status-deserialize.c @@ -568,8 +568,6 @@ static int wt_deserialize_parse(const struct wt_status *cmd_s, struct wt_status const char *line; const char *arg; - memset(s, 0, sizeof(*s)); - if ((line = my_packet_read_line(fd, &line_len)) && (skip_prefix(line, "version ", &arg))) { int version = (int)strtol(arg, NULL, 10); @@ -613,6 +611,12 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de return DESERIALIZE_ERR; } + /* + * Copy over some required fields from the current command. + */ + des_s->repo = cmd_s->repo; + des_s->index_file = cmd_s->index_file; + /* * Deserialize cached status */ @@ -700,7 +704,6 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de /* * Copy over display-related fields from the current command. */ - des_s->repo = cmd_s->repo; des_s->verbose = cmd_s->verbose; /* amend */ /* whence */