wt-status: convert struct wt_status to object_id

Change struct wt_status to use struct object_id instead of an array of
unsigned char.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson 2019-08-18 20:04:21 +00:00 коммит произвёл Junio C Hamano
Родитель 8d4d86b0f0
Коммит e0cb7cdb89
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -510,7 +510,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
s->nowarn = nowarn; s->nowarn = nowarn;
s->is_initial = get_oid(s->reference, &oid) ? 1 : 0; s->is_initial = get_oid(s->reference, &oid) ? 1 : 0;
if (!s->is_initial) if (!s->is_initial)
hashcpy(s->sha1_commit, oid.hash); oidcpy(&s->oid_commit, &oid);
s->status_format = status_format; s->status_format = status_format;
s->ignore_submodule_arg = ignore_submodule_arg; s->ignore_submodule_arg = ignore_submodule_arg;
@ -1406,7 +1406,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
s.is_initial = get_oid(s.reference, &oid) ? 1 : 0; s.is_initial = get_oid(s.reference, &oid) ? 1 : 0;
if (!s.is_initial) if (!s.is_initial)
hashcpy(s.sha1_commit, oid.hash); oidcpy(&s.oid_commit, &oid);
s.ignore_submodule_arg = ignore_submodule_arg; s.ignore_submodule_arg = ignore_submodule_arg;
s.status_format = status_format; s.status_format = status_format;

Просмотреть файл

@ -2025,7 +2025,7 @@ static void wt_porcelain_v2_print_tracking(struct wt_status *s)
char eol = s->null_termination ? '\0' : '\n'; char eol = s->null_termination ? '\0' : '\n';
fprintf(s->fp, "# branch.oid %s%c", fprintf(s->fp, "# branch.oid %s%c",
(s->is_initial ? "(initial)" : sha1_to_hex(s->sha1_commit)), (s->is_initial ? "(initial)" : oid_to_hex(&s->oid_commit)),
eol); eol);
if (!s->branch) if (!s->branch)

Просмотреть файл

@ -116,7 +116,7 @@ struct wt_status {
int rename_limit; int rename_limit;
enum wt_status_format status_format; enum wt_status_format status_format;
struct wt_status_state state; struct wt_status_state state;
unsigned char sha1_commit[GIT_MAX_RAWSZ]; /* when not Initial */ struct object_id oid_commit; /* when not Initial */
/* These are computed during processing of the individual sections */ /* These are computed during processing of the individual sections */
int committable; int committable;