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 /sequencer.c | |
| parent | Merge branch 'pw/rebase-i-cleanup-fix' (diff) | |
| parent | revision: retain argv NULL invariant in setup_revisions() (diff) | |
| download | git-4bac57bc67fbd3e319c2e70ffad63add6a273f6a.tar.gz git-4bac57bc67fbd3e319c2e70ffad63add6a273f6a.zip | |
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 'sequencer.c')
| -rw-r--r-- | sequencer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c index 6d29a938aa..5476d39ba9 100644 --- a/sequencer.c +++ b/sequencer.c @@ -6052,8 +6052,8 @@ static int make_script_with_merges(struct pretty_print_context *pp, return 0; } -int sequencer_make_script(struct repository *r, struct strbuf *out, int argc, - const char **argv, unsigned flags) +int sequencer_make_script(struct repository *r, struct strbuf *out, + struct strvec *argv, unsigned flags) { char *format = NULL; struct pretty_print_context pp = {0}; @@ -6094,7 +6094,8 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc, pp.fmt = revs.commit_format; pp.output_encoding = get_log_output_encoding(); - if (setup_revisions(argc, argv, &revs, NULL) > 1) { + setup_revisions_from_strvec(argv, &revs, NULL); + if (argv->nr > 1) { ret = error(_("make_script: unhandled options")); goto cleanup; } |
