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>
brian m. carlson committed
Aug 18, 2019 at 20:04 UTC
e0cb7cdb898d65bca6f1f4ff1d80f15a09b576db
3 files changed
+4
-4
builtin/commit.c
+2
-2
@@ -510,7 +510,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
510
s->nowarn = nowarn;
511
s->is_initial = get_oid(s->reference, &oid) ? 1 : 0;
512
if (!s->is_initial)
513
- hashcpy(s->sha1_commit, oid.hash);
513
+ oidcpy(&s->oid_commit, &oid);
514
s->status_format = status_format;
515
s->ignore_submodule_arg = ignore_submodule_arg;
516
@@ -1406,7 +1406,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
1406
1407
s.is_initial = get_oid(s.reference, &oid) ? 1 : 0;
1408
if (!s.is_initial)
1409
- hashcpy(s.sha1_commit, oid.hash);
1409
+ oidcpy(&s.oid_commit, &oid);
1410
1411
s.ignore_submodule_arg = ignore_submodule_arg;
1412
s.status_format = status_format;
wt-status.c
+1
-1
@@ -2025,7 +2025,7 @@ static void wt_porcelain_v2_print_tracking(struct wt_status *s)
2025
char eol = s->null_termination ? '\0' : '\n';
2026
2027
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)),
2029
eol);
2030
2031
if (!s->branch)
wt-status.h
+1
-1
@@ -116,7 +116,7 @@ struct wt_status {
116
int rename_limit;
117
enum wt_status_format status_format;
118
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 */
120
121
/* These are computed during processing of the individual sections */
122
int committable;