diff options
author | Jeff King <peff@peff.net> | 2016-02-11 17:26:44 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-12 12:51:15 -0800 |
commit | bd64516aca4d4e22acb33c71429d293a14d355cf (patch) | |
tree | b5ecc69581925bd95e262aa2b203fb3e63756091 /list-objects.c | |
parent | 13528ab37cadb4d4f7384d0449489760912904b8 (diff) | |
download | git-bd64516aca4d4e22acb33c71429d293a14d355cf.tar.gz |
list-objects: drop name_path entirely
In the previous commit, we left name_path as a thin wrapper
around a strbuf. This patch drops it entirely. As a result,
every show_object_fn callback needs to be adjusted. However,
none of their code needs to be changed at all, because the
only use was to pass it to path_name(), which now handles
the bare strbuf.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects.c')
-rw-r--r-- | list-objects.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/list-objects.c b/list-objects.c index 4f60a3ea2a..43977665d3 100644 --- a/list-objects.c +++ b/list-objects.c @@ -11,7 +11,7 @@ static void process_blob(struct rev_info *revs, struct blob *blob, show_object_fn show, - struct name_path *path, + struct strbuf *path, const char *name, void *cb_data) { @@ -52,7 +52,7 @@ static void process_blob(struct rev_info *revs, static void process_gitlink(struct rev_info *revs, const unsigned char *sha1, show_object_fn show, - struct name_path *path, + struct strbuf *path, const char *name, void *cb_data) { @@ -69,7 +69,6 @@ static void process_tree(struct rev_info *revs, struct object *obj = &tree->object; struct tree_desc desc; struct name_entry entry; - struct name_path me; enum interesting match = revs->diffopt.pathspec.nr == 0 ? all_entries_interesting: entry_not_interesting; int baselen = base->len; @@ -87,8 +86,7 @@ static void process_tree(struct rev_info *revs, } obj->flags |= SEEN; - me.base = base; - show(obj, &me, name, cb_data); + show(obj, base, name, cb_data); strbuf_addstr(base, name); if (base->len) @@ -113,12 +111,12 @@ static void process_tree(struct rev_info *revs, cb_data); else if (S_ISGITLINK(entry.mode)) process_gitlink(revs, entry.sha1, - show, &me, entry.path, + show, base, entry.path, cb_data); else process_blob(revs, lookup_blob(entry.sha1), - show, &me, entry.path, + show, base, entry.path, cb_data); } strbuf_setlen(base, baselen); |