diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-03-16 10:42:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-16 10:42:02 -0700 |
commit | 717e3551b9fbfdb72e40a81fc0fb714cdaadb37f (patch) | |
tree | 50603b105a7037d2a613c82f1d98c872a238ce68 /pack-bitmap.c | |
parent | 833e48259e23aea76f3765d28d1b2200332301f7 (diff) | |
parent | 253ce7a15c251057464b130016c74cbe10fe9e57 (diff) | |
download | git-717e3551b9fbfdb72e40a81fc0fb714cdaadb37f.tar.gz git-717e3551b9fbfdb72e40a81fc0fb714cdaadb37f.tar.xz |
Merge branch 'jk/path-name-safety-2.5' into jk/path-name-safety-2.6
* jk/path-name-safety-2.5:
list-objects: pass full pathname to callbacks
list-objects: drop name_path entirely
list-objects: convert name_path to a strbuf
show_object_with_name: simplify by using path_name()
http-push: stop using name_path
tree-diff: catch integer overflow in combine_diff_path allocation
add helpers for detecting size_t overflow
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r-- | pack-bitmap.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 637770af8..aee7acf39 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -422,19 +422,15 @@ static int ext_index_add_object(struct object *object, const char *name) return bitmap_pos + bitmap_git.pack->num_objects; } -static void show_object(struct object *object, const struct name_path *path, - const char *last, void *data) +static void show_object(struct object *object, const char *name, void *data) { struct bitmap *base = data; int bitmap_pos; bitmap_pos = bitmap_position(object->sha1); - if (bitmap_pos < 0) { - char *name = path_name(path, last); + if (bitmap_pos < 0) bitmap_pos = ext_index_add_object(object, name); - free(name); - } bitmap_set(base, bitmap_pos); } @@ -902,9 +898,8 @@ struct bitmap_test_data { size_t seen; }; -static void test_show_object(struct object *object, - const struct name_path *path, - const char *last, void *data) +static void test_show_object(struct object *object, const char *name, + void *data) { struct bitmap_test_data *tdata = data; int bitmap_pos; |