aboutsummaryrefslogtreecommitdiff
path: root/builtin/stash.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-09-29 11:40:34 -0700
committerJunio C Hamano <gitster@pobox.com>2025-09-29 11:40:34 -0700
commit4bac57bc67fbd3e319c2e70ffad63add6a273f6a (patch)
treec30a5f28893af6f1e1e3114adb126160716ada18 /builtin/stash.c
parent84edf9956893195b260ca20bdca1cfe0dae6d859 (diff)
parenta04bc71725f27e6210602a981563511925f798b0 (diff)
downloadgit-4bac57bc67fbd3e319c2e70ffad63add6a273f6a.tar.xz
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/stash.c')
-rw-r--r--builtin/stash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/stash.c b/builtin/stash.c
index b7db7c8364..bea64d04a0 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1015,8 +1015,8 @@ static int show_stash(int argc, const char **argv, const char *prefix,
}
}
- argc = setup_revisions(revision_args.nr, revision_args.v, &rev, NULL);
- if (argc > 1)
+ setup_revisions_from_strvec(&revision_args, &rev, NULL);
+ if (revision_args.nr > 1)
goto usage;
if (!rev.diffopt.output_format) {
rev.diffopt.output_format = DIFF_FORMAT_PATCH;