}
static void show_object(struct object *obj,
- const struct name_path *path, const char *last,
+ struct strbuf *path, const char *last,
void *data)
{
char *name = path_name(path, last);
}
static void record_recent_object(struct object *obj,
- const struct name_path *path,
+ struct strbuf *path,
const char *last,
void *data)
{
}
static void finish_object(struct object *obj,
- const struct name_path *path, const char *name,
+ struct strbuf *path, const char *name,
void *cb_data)
{
struct rev_list_info *info = cb_data;
}
static void show_object(struct object *obj,
- const struct name_path *path, const char *component,
+ struct strbuf *path, const char *component,
void *cb_data)
{
struct rev_list_info *info = cb_data;
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)
{
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)
{
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;
}
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)
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);
#define LIST_OBJECTS_H
typedef void (*show_commit_fn)(struct commit *, void *);
-typedef void (*show_object_fn)(struct object *, const struct name_path *, const char *, void *);
+typedef void (*show_object_fn)(struct object *, struct strbuf *, const char *, void *);
void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);
typedef void (*show_edge_fn)(struct commit *);
return entry->in_pack_pos;
}
-static void show_object(struct object *object, const struct name_path *path,
+static void show_object(struct object *object, struct strbuf *path,
const char *last, void *data)
{
struct bitmap *base = data;
return bitmap_pos + bitmap_git.pack->num_objects;
}
-static void show_object(struct object *object, const struct name_path *path,
+static void show_object(struct object *object, struct strbuf *path,
const char *last, void *data)
{
struct bitmap *base = data;
};
static void test_show_object(struct object *object,
- const struct name_path *path,
+ struct strbuf *path,
const char *last, void *data)
{
struct bitmap_test_data *tdata = data;
* The traversal will have already marked us as SEEN, so we
* only need to handle any progress reporting here.
*/
-static void mark_object(struct object *obj, const struct name_path *path,
+static void mark_object(struct object *obj, struct strbuf *path,
const char *name, void *data)
{
update_progress(data);
static const char *term_bad;
static const char *term_good;
-char *path_name(const struct name_path *path, const char *name)
+char *path_name(struct strbuf *path, const char *name)
{
struct strbuf ret = STRBUF_INIT;
if (path)
- strbuf_addbuf(&ret, path->base);
+ strbuf_addbuf(&ret, path);
strbuf_addstr(&ret, name);
return strbuf_detach(&ret, NULL);
}
void show_object_with_name(FILE *out, struct object *obj,
- const struct name_path *path, const char *component)
+ struct strbuf *path, const char *component)
{
char *name = path_name(path, component);
char *p;
extern void mark_parents_uninteresting(struct commit *commit);
extern void mark_tree_uninteresting(struct tree *tree);
-struct name_path {
- struct strbuf *base;
-};
-
-char *path_name(const struct name_path *path, const char *name);
+char *path_name(struct strbuf *path, const char *name);
extern void show_object_with_name(FILE *, struct object *,
- const struct name_path *, const char *);
+ struct strbuf *, const char *);
extern void add_pending_object(struct rev_info *revs,
struct object *obj, const char *name);