Skip to content

Commit e0cb7cd

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8d4d86b commit e0cb7cd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

builtin/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
510510
s->nowarn = nowarn;
511511
s->is_initial = get_oid(s->reference, &oid) ? 1 : 0;
512512
if (!s->is_initial)
513-
hashcpy(s->sha1_commit, oid.hash);
513+
oidcpy(&s->oid_commit, &oid);
514514
s->status_format = status_format;
515515
s->ignore_submodule_arg = ignore_submodule_arg;
516516

@@ -1406,7 +1406,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
14061406

14071407
s.is_initial = get_oid(s.reference, &oid) ? 1 : 0;
14081408
if (!s.is_initial)
1409-
hashcpy(s.sha1_commit, oid.hash);
1409+
oidcpy(&s.oid_commit, &oid);
14101410

14111411
s.ignore_submodule_arg = ignore_submodule_arg;
14121412
s.status_format = status_format;

wt-status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ static void wt_porcelain_v2_print_tracking(struct wt_status *s)
20252025
char eol = s->null_termination ? '\0' : '\n';
20262026

20272027
fprintf(s->fp, "# branch.oid %s%c",
2028-
(s->is_initial ? "(initial)" : sha1_to_hex(s->sha1_commit)),
2028+
(s->is_initial ? "(initial)" : oid_to_hex(&s->oid_commit)),
20292029
eol);
20302030

20312031
if (!s->branch)

wt-status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct wt_status {
116116
int rename_limit;
117117
enum wt_status_format status_format;
118118
struct wt_status_state state;
119-
unsigned char sha1_commit[GIT_MAX_RAWSZ]; /* when not Initial */
119+
struct object_id oid_commit; /* when not Initial */
120120

121121
/* These are computed during processing of the individual sections */
122122
int committable;

0 commit comments

Comments
 (0)