Skip to content

Commit

Permalink
fixup! status: add status serialization mechanism
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Oct 9, 2024
1 parent 7473add commit 91bb76c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wt-status-deserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 91bb76c

Please sign in to comment.