]> git.ipfire.org Git - thirdparty/git.git/blobdiff - json-writer.c
reftable: avoid writing empty keys at the block layer
[thirdparty/git.git] / json-writer.c
index aadb9dbddc33ef38a45342defd5fcccfd9c07d57..f1cfd8fa8c664bfca0dcaada59e59af8dd2db38a 100644 (file)
@@ -3,10 +3,8 @@
 
 void jw_init(struct json_writer *jw)
 {
-       strbuf_init(&jw->json, 0);
-       strbuf_init(&jw->open_stack, 0);
-       jw->need_comma = 0;
-       jw->pretty = 0;
+       struct json_writer blank = JSON_WRITER_INIT;
+       memcpy(jw, &blank, sizeof(*jw));;
 }
 
 void jw_release(struct json_writer *jw)