Convert find_unique_abbrev* to struct object_id
Convert find_unique_abbrev and find_unique_abbrev_r to each take a pointer to struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 12, 2018 at 02:27 UTC
aab9583f7b5ea5463eb3f653a0b4ecac7539dc94
28 files changed
+61
-59
builtin/blame.c
+1
-1
@@ -499,7 +499,7 @@ static int read_ancestry(const char *graft_file)
499
500
static int update_auto_abbrev(int auto_abbrev, struct blame_origin *suspect)
501
{
502
- const char *uniq = find_unique_abbrev(suspect->commit->object.oid.hash,
502
+ const char *uniq = find_unique_abbrev(&suspect->commit->object.oid,
503
auto_abbrev);
504
int len = strlen(uniq);
505
if (auto_abbrev < len)
builtin/branch.c
+1
-1
@@ -273,7 +273,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
273
bname.buf,
274
(flags & REF_ISBROKEN) ? "broken"
275
: (flags & REF_ISSYMREF) ? target
276
- : find_unique_abbrev(oid.hash, DEFAULT_ABBREV));
276
+ : find_unique_abbrev(&oid, DEFAULT_ABBREV));
277
}
278
delete_branch_config(bname.buf);
279
builtin/checkout.c
+3
-3
@@ -405,10 +405,10 @@ static void describe_detached_head(const char *msg, struct commit *commit)
405
pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);
406
if (print_sha1_ellipsis()) {
407
fprintf(stderr, "%s %s... %s\n", msg,
408
- find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
408
+ find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV), sb.buf);
409
} else {
410
fprintf(stderr, "%s %s %s\n", msg,
411
- find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
411
+ find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV), sb.buf);
412
}
413
strbuf_release(&sb);
414
}
@@ -778,7 +778,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
778
" git branch <new-branch-name> %s\n\n",
779
/* Give ngettext() the count */
780
lost),
781
- find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV));
781
+ find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
782
}
783
784
/*
builtin/describe.c
+2
-2
@@ -285,7 +285,7 @@ static void append_name(struct commit_name *n, struct strbuf *dst)
285
286
static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst)
287
{
288
- strbuf_addf(dst, "-%d-g%s", depth, find_unique_abbrev(oid->hash, abbrev));
288
+ strbuf_addf(dst, "-%d-g%s", depth, find_unique_abbrev(oid, abbrev));
289
}
290
291
static void describe_commit(struct object_id *oid, struct strbuf *dst)
@@ -383,7 +383,7 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
383
if (!match_cnt) {
384
struct object_id *cmit_oid = &cmit->object.oid;
385
if (always) {
386
- strbuf_add_unique_abbrev(dst, cmit_oid->hash, abbrev);
386
+ strbuf_add_unique_abbrev(dst, cmit_oid, abbrev);
387
if (suffix)
388
strbuf_addstr(dst, suffix);
389
return;
builtin/log.c
+2
-2
@@ -1873,12 +1873,12 @@ static void print_commit(char sign, struct commit *commit, int verbose,
1873
{
1874
if (!verbose) {
1875
fprintf(file, "%c %s\n", sign,
1876
- find_unique_abbrev(commit->object.oid.hash, abbrev));
1876
+ find_unique_abbrev(&commit->object.oid, abbrev));
1877
} else {
1878
struct strbuf buf = STRBUF_INIT;
1879
pp_commit_easy(CMIT_FMT_ONELINE, commit, &buf);
1880
fprintf(file, "%c %s %s\n", sign,
1881
- find_unique_abbrev(commit->object.oid.hash, abbrev),
1881
+ find_unique_abbrev(&commit->object.oid, abbrev),
1882
buf.buf);
1883
strbuf_release(&buf);
1884
}
builtin/ls-files.c
+2
-2
@@ -240,7 +240,7 @@ static void show_ce(struct repository *repo, struct dir_struct *dir,
240
printf("%s%06o %s %d\t",
241
tag,
242
ce->ce_mode,
243
- find_unique_abbrev(ce->oid.hash, abbrev),
243
+ find_unique_abbrev(&ce->oid, abbrev),
244
ce_stage(ce));
245
}
246
write_eolinfo(repo->index, ce, fullname);
@@ -271,7 +271,7 @@ static void show_ru_info(const struct index_state *istate)
271
if (!ui->mode[i])
272
continue;
273
printf("%s%06o %s %d\t", tag_resolve_undo, ui->mode[i],
274
- find_unique_abbrev(ui->oid[i].hash, abbrev),
274
+ find_unique_abbrev(&ui->oid[i], abbrev),
275
i + 1);
276
write_name(path);
277
}
builtin/ls-tree.c
+2
-2
@@ -103,11 +103,11 @@ static int show_tree(const struct object_id *oid, struct strbuf *base,
103
} else
104
xsnprintf(size_text, sizeof(size_text), "-");
105
printf("%06o %s %s %7s\t", mode, type,
106
- find_unique_abbrev(oid->hash, abbrev),
106
+ find_unique_abbrev(oid, abbrev),
107
size_text);
108
} else
109
printf("%06o %s %s\t", mode, type,
110
- find_unique_abbrev(oid->hash, abbrev));
110
+ find_unique_abbrev(oid, abbrev));
111
}
112
baselen = base->len;
113
strbuf_addstr(base, pathname);
builtin/merge.c
+3
-3
@@ -1327,7 +1327,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1327
1328
check_commit_signature(commit, &signature_check);
1329
1330
- find_unique_abbrev_r(hex, commit->object.oid.hash, DEFAULT_ABBREV);
1330
+ find_unique_abbrev_r(hex, &commit->object.oid, DEFAULT_ABBREV);
1331
switch (signature_check.result) {
1332
case 'G':
1333
break;
@@ -1420,9 +1420,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1420
1421
if (verbosity >= 0) {
1422
printf(_("Updating %s..%s\n"),
1423
- find_unique_abbrev(head_commit->object.oid.hash,
1423
+ find_unique_abbrev(&head_commit->object.oid,
1424
DEFAULT_ABBREV),
1425
- find_unique_abbrev(remoteheads->item->object.oid.hash,
1425
+ find_unique_abbrev(&remoteheads->item->object.oid,
1426
DEFAULT_ABBREV));
1427
}
1428
strbuf_addstr(&msg, "Fast-forward");
builtin/name-rev.c
+1
-1
@@ -328,7 +328,7 @@ static void show_name(const struct object *obj,
328
else if (allow_undefined)
329
printf("undefined\n");
330
else if (always)
331
- printf("%s\n", find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
331
+ printf("%s\n", find_unique_abbrev(oid, DEFAULT_ABBREV));
332
else
333
die("cannot describe '%s'", oid_to_hex(oid));
334
strbuf_release(&buf);
builtin/receive-pack.c
+4
-4
@@ -1242,11 +1242,11 @@ static void check_aliased_update(struct command *cmd, struct string_list *list)
1242
rp_error("refusing inconsistent update between symref '%s' (%s..%s) and"
1243
" its target '%s' (%s..%s)",
1244
cmd->ref_name,
1245
- find_unique_abbrev(cmd->old_oid.hash, DEFAULT_ABBREV),
1246
- find_unique_abbrev(cmd->new_oid.hash, DEFAULT_ABBREV),
1245
+ find_unique_abbrev(&cmd->old_oid, DEFAULT_ABBREV),
1246
+ find_unique_abbrev(&cmd->new_oid, DEFAULT_ABBREV),
1247
dst_cmd->ref_name,
1248
- find_unique_abbrev(dst_cmd->old_oid.hash, DEFAULT_ABBREV),
1249
- find_unique_abbrev(dst_cmd->new_oid.hash, DEFAULT_ABBREV));
1248
+ find_unique_abbrev(&dst_cmd->old_oid, DEFAULT_ABBREV),
1249
+ find_unique_abbrev(&dst_cmd->new_oid, DEFAULT_ABBREV));
1250
1251
cmd->error_string = dst_cmd->error_string =
1252
"inconsistent aliased update";
builtin/reset.c
+1
-1
@@ -109,7 +109,7 @@ static void print_new_head_line(struct commit *commit)
109
struct strbuf buf = STRBUF_INIT;
110
111
printf(_("HEAD is now at %s"),
112
- find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV));
112
+ find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
113
114
pp_commit_easy(CMIT_FMT_ONELINE, commit, &buf);
115
if (buf.len > 0)
builtin/rev-list.c
+1
-1
@@ -108,7 +108,7 @@ static void show_commit(struct commit *commit, void *data)
108
if (!revs->graph)
109
fputs(get_revision_mark(revs, commit), stdout);
110
if (revs->abbrev_commit && revs->abbrev)
111
- fputs(find_unique_abbrev(commit->object.oid.hash, revs->abbrev),
111
+ fputs(find_unique_abbrev(&commit->object.oid, revs->abbrev),
112
stdout);
113
else
114
fputs(oid_to_hex(&commit->object.oid), stdout);
builtin/rev-parse.c
+1
-1
@@ -159,7 +159,7 @@ static void show_rev(int type, const struct object_id *oid, const char *name)
159
}
160
}
161
else if (abbrev)
162
- show_with_type(type, find_unique_abbrev(oid->hash, abbrev));
162
+ show_with_type(type, find_unique_abbrev(oid, abbrev));
163
else
164
show_with_type(type, oid_to_hex(oid));
165
}
builtin/show-branch.c
+1
-1
@@ -292,7 +292,7 @@ static void show_one_commit(struct commit *commit, int no_name)
292
}
293
else
294
printf("[%s] ",
295
- find_unique_abbrev(commit->object.oid.hash,
295
+ find_unique_abbrev(&commit->object.oid,
296
DEFAULT_ABBREV));
297
}
298
puts(pretty_str);
builtin/show-ref.c
+2
-2
@@ -29,7 +29,7 @@ static void show_one(const char *refname, const struct object_id *oid)
29
if (quiet)
30
return;
31
32
- hex = find_unique_abbrev(oid->hash, abbrev);
32
+ hex = find_unique_abbrev(oid, abbrev);
33
if (hash_only)
34
printf("%s\n", hex);
35
else
@@ -39,7 +39,7 @@ static void show_one(const char *refname, const struct object_id *oid)
39
return;
40
41
if (!peel_ref(refname, &peeled)) {
42
- hex = find_unique_abbrev(peeled.hash, abbrev);
42
+ hex = find_unique_abbrev(&peeled, abbrev);
43
printf("%s %s^{}\n", hex, refname);
44
}
45
}
builtin/tag.c
+4
-2
@@ -99,7 +99,8 @@ static int delete_tag(const char *name, const char *ref,
99
{
100
if (delete_ref(NULL, ref, oid, 0))
101
return 1;
102
- printf(_("Deleted tag '%s' (was %s)\n"), name, find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
102
+ printf(_("Deleted tag '%s' (was %s)\n"), name,
103
+ find_unique_abbrev(oid, DEFAULT_ABBREV));
104
return 0;
105
}
106
@@ -558,7 +559,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
559
die("%s", err.buf);
560
ref_transaction_free(transaction);
561
if (force && !is_null_oid(&prev) && oidcmp(&prev, &object))
561
- printf(_("Updated tag '%s' (was %s)\n"), tag, find_unique_abbrev(prev.hash, DEFAULT_ABBREV));
562
+ printf(_("Updated tag '%s' (was %s)\n"), tag,
563
+ find_unique_abbrev(&prev, DEFAULT_ABBREV));
564
565
UNLEAK(buf);
566
UNLEAK(ref);
builtin/worktree.c
+2
-2
@@ -498,7 +498,7 @@ static void show_worktree(struct worktree *wt, int path_maxlen, int abbrev_len)
498
strbuf_addstr(&sb, "(bare)");
499
else {
500
strbuf_addf(&sb, "%-*s ", abbrev_len,
501
- find_unique_abbrev(wt->head_oid.hash, DEFAULT_ABBREV));
501
+ find_unique_abbrev(&wt->head_oid, DEFAULT_ABBREV));
502
if (wt->is_detached)
503
strbuf_addstr(&sb, "(detached HEAD)");
504
else if (wt->head_ref) {
@@ -523,7 +523,7 @@ static void measure_widths(struct worktree **wt, int *abbrev, int *maxlen)
523
524
if (path_len > *maxlen)
525
*maxlen = path_len;
526
- sha1_len = strlen(find_unique_abbrev(wt[i]->head_oid.hash, *abbrev));
526
+ sha1_len = strlen(find_unique_abbrev(&wt[i]->head_oid, *abbrev));
527
if (sha1_len > *abbrev)
528
*abbrev = sha1_len;
529
}
cache.h
+3
-3
@@ -951,14 +951,14 @@ extern void sha1_file_name(struct strbuf *buf, const unsigned char *sha1);
951
* more calls to find_unique_abbrev are made.
952
*
953
* The `_r` variant writes to a buffer supplied by the caller, which must be at
954
- * least `GIT_SHA1_HEXSZ + 1` bytes. The return value is the number of bytes
954
+ * least `GIT_MAX_HEXSZ + 1` bytes. The return value is the number of bytes
955
* written (excluding the NUL terminator).
956
*
957
* Note that while this version avoids the static buffer, it is not fully
958
* reentrant, as it calls into other non-reentrant git code.
959
*/
960
-extern const char *find_unique_abbrev(const unsigned char *sha1, int len);
961
-extern int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len);
960
+extern const char *find_unique_abbrev(const struct object_id *oid, int len);
961
+extern int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len);
962
963
extern const unsigned char null_sha1[GIT_MAX_RAWSZ];
964
extern const struct object_id null_oid;
combine-diff.c
+2
-2
@@ -915,11 +915,11 @@ static void show_combined_header(struct combine_diff_path *elem,
915
"", elem->path, line_prefix, c_meta, c_reset);
916
printf("%s%sindex ", line_prefix, c_meta);
917
for (i = 0; i < num_parent; i++) {
918
- abb = find_unique_abbrev(elem->parent[i].oid.hash,
918
+ abb = find_unique_abbrev(&elem->parent[i].oid,
919
abbrev);
920
printf("%s%s", i ? "," : "", abb);
921
}
922
- abb = find_unique_abbrev(elem->oid.hash, abbrev);
922
+ abb = find_unique_abbrev(&elem->oid, abbrev);
923
printf("..%s%s\n", abb, c_reset);
924
925
if (mode_differs) {
diff.c
+1
-1
@@ -3811,7 +3811,7 @@ static int similarity_index(struct diff_filepair *p)
3811
static const char *diff_abbrev_oid(const struct object_id *oid, int abbrev)
3812
{
3813
if (startup_info->have_repository)
3814
- return find_unique_abbrev(oid->hash, abbrev);
3814
+ return find_unique_abbrev(oid, abbrev);
3815
else {
3816
char *hex = oid_to_hex(oid);
3817
if (abbrev < 0)
log-tree.c
+6
-6
@@ -177,7 +177,7 @@ static void show_parents(struct commit *commit, int abbrev, FILE *file)
177
struct commit_list *p;
178
for (p = commit->parents; p ; p = p->next) {
179
struct commit *parent = p->item;
180
- fprintf(file, " %s", find_unique_abbrev(parent->object.oid.hash, abbrev));
180
+ fprintf(file, " %s", find_unique_abbrev(&parent->object.oid, abbrev));
181
}
182
}
183
@@ -185,7 +185,7 @@ static void show_children(struct rev_info *opt, struct commit *commit, int abbre
185
{
186
struct commit_list *p = lookup_decoration(&opt->children, &commit->object);
187
for ( ; p; p = p->next) {
188
- fprintf(opt->diffopt.file, " %s", find_unique_abbrev(p->item->object.oid.hash, abbrev));
188
+ fprintf(opt->diffopt.file, " %s", find_unique_abbrev(&p->item->object.oid, abbrev));
189
}
190
}
191
@@ -558,7 +558,7 @@ void show_log(struct rev_info *opt)
558
559
if (!opt->graph)
560
put_revision_mark(opt, commit);
561
- fputs(find_unique_abbrev(commit->object.oid.hash, abbrev_commit), opt->diffopt.file);
561
+ fputs(find_unique_abbrev(&commit->object.oid, abbrev_commit), opt->diffopt.file);
562
if (opt->print_parents)
563
show_parents(commit, abbrev_commit, opt->diffopt.file);
564
if (opt->children.name)
@@ -620,7 +620,8 @@ void show_log(struct rev_info *opt)
620
621
if (!opt->graph)
622
put_revision_mark(opt, commit);
623
- fputs(find_unique_abbrev(commit->object.oid.hash, abbrev_commit),
623
+ fputs(find_unique_abbrev(&commit->object.oid,
624
+ abbrev_commit),
625
opt->diffopt.file);
626
if (opt->print_parents)
627
show_parents(commit, abbrev_commit, opt->diffopt.file);
@@ -628,8 +629,7 @@ void show_log(struct rev_info *opt)
629
show_children(opt, commit, abbrev_commit);
630
if (parent)
631
fprintf(opt->diffopt.file, " (from %s)",
631
- find_unique_abbrev(parent->object.oid.hash,
632
- abbrev_commit));
632
+ find_unique_abbrev(&parent->object.oid, abbrev_commit));
633
fputs(diff_get_color_opt(&opt->diffopt, DIFF_RESET), opt->diffopt.file);
634
show_decorations(opt, commit);
635
if (opt->commit_format == CMIT_FMT_ONELINE) {
ref-filter.c
+2
-2
@@ -742,13 +742,13 @@ static int grab_objectname(const char *name, const struct object_id *oid,
742
{
743
if (starts_with(name, "objectname")) {
744
if (atom->u.objectname.option == O_SHORT) {
745
- v->s = xstrdup(find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
745
+ v->s = xstrdup(find_unique_abbrev(oid, DEFAULT_ABBREV));
746
return 1;
747
} else if (atom->u.objectname.option == O_FULL) {
748
v->s = xstrdup(oid_to_hex(oid));
749
return 1;
750
} else if (atom->u.objectname.option == O_LENGTH) {
751
- v->s = xstrdup(find_unique_abbrev(oid->hash, atom->u.objectname.length));
751
+ v->s = xstrdup(find_unique_abbrev(oid, atom->u.objectname.length));
752
return 1;
753
} else
754
die("BUG: unknown %%(objectname) option");
sequencer.c
+1
-1
@@ -282,7 +282,7 @@ struct commit_message {
282
283
static const char *short_commit_name(struct commit *commit)
284
{
285
- return find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV);
285
+ return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV);
286
}
287
288
static int get_message(struct commit *commit, struct commit_message *out)
sha1_name.c
+6
-6
@@ -380,7 +380,7 @@ static int show_ambiguous_object(const struct object_id *oid, void *data)
380
}
381
382
advise(" %s %s%s",
383
- find_unique_abbrev(oid->hash, DEFAULT_ABBREV),
383
+ find_unique_abbrev(oid, DEFAULT_ABBREV),
384
type_name(type) ? type_name(type) : "unknown type",
385
desc.buf);
386
@@ -569,7 +569,7 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
569
find_abbrev_len_for_pack(p, mad);
570
}
571
572
-int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len)
572
+int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
573
{
574
struct disambiguate_state ds;
575
struct min_abbrev_data mad;
@@ -596,14 +596,14 @@ int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len)
596
len = FALLBACK_DEFAULT_ABBREV;
597
}
598
599
- sha1_to_hex_r(hex, sha1);
599
+ oid_to_hex_r(hex, oid);
600
if (len == GIT_SHA1_HEXSZ || !len)
601
return GIT_SHA1_HEXSZ;
602
603
mad.init_len = len;
604
mad.cur_len = len;
605
mad.hex = hex;
606
- mad.hash = sha1;
606
+ mad.hash = oid->hash;
607
608
find_abbrev_len_packed(&mad);
609
@@ -621,13 +621,13 @@ int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len)
621
return mad.cur_len;
622
}
623
624
-const char *find_unique_abbrev(const unsigned char *sha1, int len)
624
+const char *find_unique_abbrev(const struct object_id *oid, int len)
625
{
626
static int bufno;
627
static char hexbuffer[4][GIT_MAX_HEXSZ + 1];
628
char *hex = hexbuffer[bufno];
629
bufno = (bufno + 1) % ARRAY_SIZE(hexbuffer);
630
- find_unique_abbrev_r(hex, sha1, len);
630
+ find_unique_abbrev_r(hex, oid, len);
631
return hex;
632
}
633
strbuf.c
+1
-1
@@ -878,7 +878,7 @@ void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
878
{
879
int r;
880
strbuf_grow(sb, GIT_SHA1_HEXSZ + 1);
881
- r = find_unique_abbrev_r(sb->buf + sb->len, oid->hash, abbrev_len);
881
+ r = find_unique_abbrev_r(sb->buf + sb->len, oid, abbrev_len);
882
strbuf_setlen(sb, sb->len + r);
883
}
884
tag.c
+2
-2
@@ -46,7 +46,7 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
46
return error("%s: cannot verify a non-tag object of type %s.",
47
name_to_report ?
48
name_to_report :
49
- find_unique_abbrev(oid->hash, DEFAULT_ABBREV),
49
+ find_unique_abbrev(oid, DEFAULT_ABBREV),
50
type_name(type));
51
52
buf = read_sha1_file(oid->hash, &type, &size);
@@ -54,7 +54,7 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
54
return error("%s: unable to read file.",
55
name_to_report ?
56
name_to_report :
57
- find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
57
+ find_unique_abbrev(oid, DEFAULT_ABBREV));
58
59
ret = run_gpg_verify(buf, size, flags);
60
transport.c
+1
-1
@@ -461,7 +461,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count,
461
static int measure_abbrev(const struct object_id *oid, int sofar)
462
{
463
char hex[GIT_MAX_HEXSZ + 1];
464
- int w = find_unique_abbrev_r(hex, oid->hash, DEFAULT_ABBREV);
464
+ int w = find_unique_abbrev_r(hex, oid, DEFAULT_ABBREV);
465
466
return (w < sofar) ? sofar : w;
467
}
wt-status.c
+3
-3
@@ -1350,7 +1350,7 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
1350
const char *color)
1351
{
1352
status_printf_ln(s, color, _("You are currently cherry-picking commit %s."),
1353
- find_unique_abbrev(state->cherry_pick_head_oid.hash, DEFAULT_ABBREV));
1353
+ find_unique_abbrev(&state->cherry_pick_head_oid, DEFAULT_ABBREV));
1354
if (s->hints) {
1355
if (has_unmerged(s))
1356
status_printf_ln(s, color,
@@ -1369,7 +1369,7 @@ static void show_revert_in_progress(struct wt_status *s,
1369
const char *color)
1370
{
1371
status_printf_ln(s, color, _("You are currently reverting commit %s."),
1372
- find_unique_abbrev(state->revert_head_oid.hash, DEFAULT_ABBREV));
1372
+ find_unique_abbrev(&state->revert_head_oid, DEFAULT_ABBREV));
1373
if (s->hints) {
1374
if (has_unmerged(s))
1375
status_printf_ln(s, color,
@@ -1489,7 +1489,7 @@ static void wt_status_get_detached_from(struct wt_status_state *state)
1489
state->detached_from = xstrdup(from);
1490
} else
1491
state->detached_from =
1492
- xstrdup(find_unique_abbrev(cb.noid.hash, DEFAULT_ABBREV));
1492
+ xstrdup(find_unique_abbrev(&cb.noid, DEFAULT_ABBREV));
1493
oidcpy(&state->detached_oid, &cb.noid);
1494
state->detached_at = !get_oid("HEAD", &oid) &&
1495
!oidcmp(&oid, &state->detached_oid);