diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-09-29 11:40:34 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-29 11:40:34 -0700 |
| commit | 4bac57bc67fbd3e319c2e70ffad63add6a273f6a (patch) | |
| tree | c30a5f28893af6f1e1e3114adb126160716ada18 /builtin/pack-objects.c | |
| parent | 84edf9956893195b260ca20bdca1cfe0dae6d859 (diff) | |
| parent | a04bc71725f27e6210602a981563511925f798b0 (diff) | |
Merge branch 'jk/setup-revisions-freefix'
There are double frees and leaks around setup_revisions() API used
in "git stash show", which has been fixed, and setup_revisions()
API gained a wrapper to make it more ergonomic when using it with
strvec-manged argc/argv pairs.
* jk/setup-revisions-freefix:
revision: retain argv NULL invariant in setup_revisions()
treewide: pass strvecs around for setup_revisions_from_strvec()
treewide: use setup_revisions_from_strvec() when we have a strvec
revision: add wrapper to setup_revisions() from a strvec
revision: manage memory ownership of argv in setup_revisions()
stash: tell setup_revisions() to free our allocated strings
Diffstat (limited to 'builtin/pack-objects.c')
| -rw-r--r-- | builtin/pack-objects.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 1494afcf3d..5856b5f6bf 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -4650,7 +4650,7 @@ static void get_object_list_path_walk(struct rev_info *revs) die(_("failed to pack objects via path-walk")); } -static void get_object_list(struct rev_info *revs, int ac, const char **av) +static void get_object_list(struct rev_info *revs, struct strvec *argv) { struct setup_revision_opt s_r_opt = { .allow_exclude_promisor_objects = 1, @@ -4660,7 +4660,7 @@ static void get_object_list(struct rev_info *revs, int ac, const char **av) int save_warning; save_commit_buffer = 0; - setup_revisions(ac, av, revs, &s_r_opt); + setup_revisions_from_strvec(argv, revs, &s_r_opt); /* make sure shallows are read */ is_repository_shallow(the_repository); @@ -5229,7 +5229,7 @@ int cmd_pack_objects(int argc, revs.include_check = is_not_in_promisor_pack; revs.include_check_obj = is_not_in_promisor_pack_obj; } - get_object_list(&revs, rp.nr, rp.v); + get_object_list(&revs, &rp); release_revisions(&revs); } cleanup_preferred_base(); |
