aboutsummaryrefslogtreecommitdiffstats
path: root/ui-snapshot.c
diff options
context:
space:
mode:
authorChristian Hesse2020-10-06 16:32:08 +0200
committerChristian Hesse2020-10-19 20:27:28 +0200
commit629659d2cffbf059374fc53e6400ff0bebe1ddde (patch)
tree5447658c87e9aa4331e36ace5ebe295d9ed2952e /ui-snapshot.c
parent205837d4684f331afa93c946cbdfa1fa9b3d1ce9 (diff)
downloadcgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.tar.gz
cgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.tar.bz2
cgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.zip
git: update to v2.29.0
Update to git version v2.29.0, this requires changes for these upstream commits: * dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98 strvec: rename files from argv-array to strvec * 873cd28a8b17ff21908c78c7929a7615f8c94992 argv-array: rename to strvec * d70a9eb611a9d242c1d26847d223b8677609305b strvec: rename struct fields * 6a67c759489e1025665adf78326e9e0d0981bab5 test-lib-functions: restrict test_must_fail usage Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'ui-snapshot.c')
-rw-r--r--ui-snapshot.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 556d3ed..18361a6 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -13,32 +13,32 @@
13 13
14static int write_archive_type(const char *format, const char *hex, const char *prefix) 14static int write_archive_type(const char *format, const char *hex, const char *prefix)
15{ 15{
16 struct argv_array argv = ARGV_ARRAY_INIT; 16 struct strvec argv = STRVEC_INIT;
17 const char **nargv; 17 const char **nargv;
18 int result; 18 int result;
19 argv_array_push(&argv, "snapshot"); 19 strvec_push(&argv, "snapshot");
20 argv_array_push(&argv, format); 20 strvec_push(&argv, format);
21 if (prefix) { 21 if (prefix) {
22 struct strbuf buf = STRBUF_INIT; 22 struct strbuf buf = STRBUF_INIT;
23 strbuf_addstr(&buf, prefix); 23 strbuf_addstr(&buf, prefix);
24 strbuf_addch(&buf, '/'); 24 strbuf_addch(&buf, '/');
25 argv_array_push(&argv, "--prefix"); 25 strvec_push(&argv, "--prefix");
26 argv_array_push(&argv, buf.buf); 26 strvec_push(&argv, buf.buf);
27 strbuf_release(&buf); 27 strbuf_release(&buf);
28 } 28 }
29 argv_array_push(&argv, hex); 29 strvec_push(&argv, hex);
30 /* 30 /*
31 * Now we need to copy the pointers to arguments into a new 31 * Now we need to copy the pointers to arguments into a new
32 * structure because write_archive will rearrange its arguments 32 * structure because write_archive will rearrange its arguments
33 * which may result in duplicated/missing entries causing leaks 33 * which may result in duplicated/missing entries causing leaks
34 * or double-frees in argv_array_clear. 34 * or double-frees in strvec_clear.
35 */ 35 */
36 nargv = xmalloc(sizeof(char *) * (argv.argc + 1)); 36 nargv = xmalloc(sizeof(char *) * (argv.nr + 1));
37 /* argv_array guarantees a trailing NULL entry. */ 37 /* strvec guarantees a trailing NULL entry. */
38 memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1)); 38 memcpy(nargv, argv.v, sizeof(char *) * (argv.nr + 1));
39 39
40 result = write_archive(argv.argc, nargv, NULL, the_repository, NULL, 0); 40 result = write_archive(argv.nr, nargv, NULL, the_repository, NULL, 0);
41 argv_array_clear(&argv); 41 strvec_clear(&argv);
42 free(nargv); 42 free(nargv);
43 return result; 43 return result;
44} 44}