n->name_checked = 1;
}
- if (n->tag)
+ if (n->tag) {
+ if (all)
- printf("tags/");
- printf("%s", n->tag->tag);
++ strbuf_addstr(dst, "tags/");
+ strbuf_addstr(dst, n->tag->tag);
- else
+ } else {
- printf("%s", n->path);
+ strbuf_addstr(dst, n->path);
+ }
}
-static void show_suffix(int depth, const struct object_id *oid)
+static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst)
{
- printf("-%d-g%s", depth, find_unique_abbrev(oid->hash, abbrev));
+ strbuf_addf(dst, "-%d-g%s", depth, find_unique_abbrev(oid->hash, abbrev));
}
-static void describe(const char *arg, int last_one)
+static void describe_commit(struct object_id *oid, struct strbuf *dst)
{
- struct object_id oid;
struct commit *cmit, *gave_up_on = NULL;
struct commit_list *list;
struct commit_name *n;