strbuf: convert strbuf_add_unique_abbrev to use struct object_id
Convert the declaration and definition of strbuf_add_unique_abbrev to make it take a pointer to struct object_id. Predeclare the struct in strbuf.h, as cache.h includes strbuf.h before it declares the struct, and otherwise the struct declaration would have the wrong scope. Apply the following semantic patch, along with the standard object_id transforms, to adjust the callers: @@ expression E1, E2, E3; @@ - strbuf_add_unique_abbrev(E1, E2.hash, E3); + strbuf_add_unique_abbrev(E1, &E2, E3); @@ expression E1, E2, E3; @@ - strbuf_add_unique_abbrev(E1, E2->hash, E3); + strbuf_add_unique_abbrev(E1, E2, E3); Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1776979573
commit
30e677e0e2
@ -720,7 +720,7 @@ static int add_pending_uninteresting_ref(const char *refname,
|
||||
static void describe_one_orphan(struct strbuf *sb, struct commit *commit)
|
||||
{
|
||||
strbuf_addstr(sb, " ");
|
||||
strbuf_add_unique_abbrev(sb, commit->object.oid.hash, DEFAULT_ABBREV);
|
||||
strbuf_add_unique_abbrev(sb, &commit->object.oid, DEFAULT_ABBREV);
|
||||
strbuf_addch(sb, ' ');
|
||||
if (!parse_commit(commit))
|
||||
pp_commit_easy(CMIT_FMT_ONELINE, commit, sb);
|
||||
|
Reference in New Issue
Block a user