mirror of
https://github.com/git/git.git
synced 2026-01-09 01:34:00 +00:00
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
This commit is contained in:
@@ -913,13 +913,12 @@ static void deepen(struct upload_pack_data *data, int depth)
|
||||
}
|
||||
|
||||
static void deepen_by_rev_list(struct upload_pack_data *data,
|
||||
int ac,
|
||||
const char **av)
|
||||
struct strvec *argv)
|
||||
{
|
||||
struct commit_list *result;
|
||||
|
||||
disable_commit_graph(the_repository);
|
||||
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
|
||||
result = get_shallow_commits_by_rev_list(argv, SHALLOW, NOT_SHALLOW);
|
||||
send_shallow(data, result);
|
||||
free_commit_list(result);
|
||||
send_unshallow(data);
|
||||
@@ -955,7 +954,7 @@ static int send_shallow_list(struct upload_pack_data *data)
|
||||
struct object *o = data->want_obj.objects[i].item;
|
||||
strvec_push(&av, oid_to_hex(&o->oid));
|
||||
}
|
||||
deepen_by_rev_list(data, av.nr, av.v);
|
||||
deepen_by_rev_list(data, &av);
|
||||
strvec_clear(&av);
|
||||
ret = 1;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user