diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-03-12 02:27:28 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-14 09:23:48 -0700 |
commit | 30e677e0e243ebb29a5f5aeed8c850bbae9020fa (patch) | |
tree | a974611a14bd9f2b0b74116bfe96fc362762f196 /builtin/tag.c | |
parent | ref-filter: convert grab_objectname to struct object_id (diff) | |
download | tgif-30e677e0e243ebb29a5f5aeed8c850bbae9020fa.tar.xz |
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>
Diffstat (limited to 'builtin/tag.c')
-rw-r--r-- | builtin/tag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/tag.c b/builtin/tag.c index 8c493a569f..a5fc6c090f 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -293,7 +293,7 @@ static void create_reflog_msg(const struct object_id *oid, struct strbuf *sb) strbuf_addstr(sb, rla); } else { strbuf_addstr(sb, "tag: tagging "); - strbuf_add_unique_abbrev(sb, oid->hash, DEFAULT_ABBREV); + strbuf_add_unique_abbrev(sb, oid, DEFAULT_ABBREV); } strbuf_addstr(sb, " ("); |