aboutsummaryrefslogtreecommitdiff
path: root/builtin-rev-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-rev-list.c')
-rw-r--r--builtin-rev-list.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 759e6714c..aa3c962e5 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -169,20 +169,21 @@ static void finish_commit(struct commit *commit)
commit->buffer = NULL;
}
-static void finish_object(struct object *obj, const char *name)
+static void finish_object(struct object *obj, const struct name_path *path, const char *name)
{
if (obj->type == OBJ_BLOB && !has_sha1_file(obj->sha1))
die("missing blob object '%s'", sha1_to_hex(obj->sha1));
}
-static void show_object(struct object *obj, const char *name)
+static void show_object(struct object *obj, const struct name_path *path, const char *component)
{
+ char *name = path_name(path, component);
/* An object with name "foo\n0000000..." can be used to
* confuse downstream "git pack-objects" very badly.
*/
const char *ep = strchr(name, '\n');
- finish_object(obj, name);
+ finish_object(obj, path, name);
if (ep) {
printf("%s %.*s\n", sha1_to_hex(obj->sha1),
(int) (ep - name),
@@ -190,6 +191,7 @@ static void show_object(struct object *obj, const char *name)
}
else
printf("%s %s\n", sha1_to_hex(obj->sha1), name);
+ free(name);
}
static void show_edge(struct commit *commit)