diff options
| author | Junio C Hamano <gitster@pobox.com> | 2016-03-16 13:15:04 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2016-03-16 13:15:04 -0700 |
| commit | d79db92483f78f0a750b6093432374fa1069b2ba (patch) | |
| tree | 915cb72714cc5fb380382b27cd6da2861b4d71f2 /pack-bitmap.c | |
| parent | 594730e980521310d88006d91f3f14ef5eff1e2b (diff) | |
| parent | 55c45a732582ca74d9f8a73c8f176d3dadd5b819 (diff) | |
| download | git-d79db92483f78f0a750b6093432374fa1069b2ba.tar.xz | |
Merge branch 'jk/path-name-safety-2.7' into maint
* jk/path-name-safety-2.7:
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 cb9c622803..d92394692e 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -417,19 +417,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->oid.hash); - 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); } @@ -897,9 +893,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; |
