<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -124,11 +124,10 @@ static int write_tar_entry(struct archiver_args *args,
 		unsigned int mode, void *buffer, unsigned long size)
 {
 	struct ustar_header header;
-	struct strbuf ext_header;
+	struct strbuf ext_header = STRBUF_INIT;
 	int err = 0;
 
 	memset(&amp;header, 0, sizeof(header));
-	strbuf_init(&amp;ext_header, 0);
 
 	if (!sha1) {
 		*header.typeflag = TYPEFLAG_GLOBAL_HEADER;
@@ -211,10 +210,9 @@ static int write_tar_entry(struct archiver_args *args,
 static int write_global_extended_header(struct archiver_args *args)
 {
 	const unsigned char *sha1 = args-&gt;commit_sha1;
-	struct strbuf ext_header;
+	struct strbuf ext_header = STRBUF_INIT;
 	int err;
 
-	strbuf_init(&amp;ext_header, 0);
 	strbuf_append_ext_header(&amp;ext_header, &quot;comment&quot;, sha1_to_hex(sha1), 40);
 	err = write_tar_entry(args, NULL, NULL, 0, 0, ext_header.buf,
 			ext_header.len);</diff>
      <filename>archive-tar.c</filename>
    </modified>
    <modified>
      <diff>@@ -29,11 +29,10 @@ static void format_subst(const struct commit *commit,
                          struct strbuf *buf)
 {
 	char *to_free = NULL;
-	struct strbuf fmt;
+	struct strbuf fmt = STRBUF_INIT;
 
 	if (src == buf-&gt;buf)
 		to_free = strbuf_detach(buf, NULL);
-	strbuf_init(&amp;fmt, 0);
 	for (;;) {
 		const char *b, *c;
 
@@ -65,10 +64,9 @@ static void *sha1_file_to_archive(const char *path, const unsigned char *sha1,
 
 	buffer = read_sha1_file(sha1, type, sizep);
 	if (buffer &amp;&amp; S_ISREG(mode)) {
-		struct strbuf buf;
+		struct strbuf buf = STRBUF_INIT;
 		size_t size = 0;
 
-		strbuf_init(&amp;buf, 0);
 		strbuf_attach(&amp;buf, buffer, *sizep, *sizep + 1);
 		convert_to_working_tree(path, buf.buf, buf.len, &amp;buf);
 		if (commit)</diff>
      <filename>archive.c</filename>
    </modified>
    <modified>
      <diff>@@ -321,13 +321,12 @@ static char *find_name(const char *line, char *def, int p_value, int terminate)
 	const char *start = line;
 
 	if (*line == '&quot;') {
-		struct strbuf name;
+		struct strbuf name = STRBUF_INIT;
 
 		/*
 		 * Proposed &quot;new-style&quot; GNU patch/diff format; see
 		 * http://marc.theaimsgroup.com/?l=git&amp;m=112927316408690&amp;w=2
 		 */
-		strbuf_init(&amp;name, 0);
 		if (!unquote_c_style(&amp;name, line, NULL)) {
 			char *cp;
 
@@ -675,11 +674,8 @@ static char *git_header_name(char *line, int llen)
 
 	if (*line == '&quot;') {
 		const char *cp;
-		struct strbuf first;
-		struct strbuf sp;
-
-		strbuf_init(&amp;first, 0);
-		strbuf_init(&amp;sp, 0);
+		struct strbuf first = STRBUF_INIT;
+		struct strbuf sp = STRBUF_INIT;
 
 		if (unquote_c_style(&amp;first, line, &amp;second))
 			goto free_and_fail1;
@@ -741,10 +737,9 @@ static char *git_header_name(char *line, int llen)
 	 */
 	for (second = name; second &lt; line + llen; second++) {
 		if (*second == '&quot;') {
-			struct strbuf sp;
+			struct strbuf sp = STRBUF_INIT;
 			const char *np;
 
-			strbuf_init(&amp;sp, 0);
 			if (unquote_c_style(&amp;sp, second, NULL))
 				goto free_and_fail2;
 
@@ -1508,11 +1503,10 @@ static const char minuses[]=
 
 static void show_stats(struct patch *patch)
 {
-	struct strbuf qname;
+	struct strbuf qname = STRBUF_INIT;
 	char *cp = patch-&gt;new_name ? patch-&gt;new_name : patch-&gt;old_name;
 	int max, add, del;
 
-	strbuf_init(&amp;qname, 0);
 	quote_c_style(cp, &amp;qname, NULL, 0);
 
 	/*
@@ -2292,14 +2286,12 @@ static void add_to_fn_table(struct patch *patch)
 
 static int apply_data(struct patch *patch, struct stat *st, struct cache_entry *ce)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	struct image image;
 	size_t len;
 	char *img;
 	struct patch *tpatch;
 
-	strbuf_init(&amp;buf, 0);
-
 	if (!(patch-&gt;is_copy || patch-&gt;is_rename) &amp;&amp;
 	    ((tpatch = in_fn_table(patch-&gt;old_name)) != NULL)) {
 		if (tpatch == (struct patch *) -1) {
@@ -2779,7 +2771,7 @@ static void add_index_file(const char *path, unsigned mode, void *buf, unsigned
 static int try_create_file(const char *path, unsigned int mode, const char *buf, unsigned long size)
 {
 	int fd;
-	struct strbuf nbuf;
+	struct strbuf nbuf = STRBUF_INIT;
 
 	if (S_ISGITLINK(mode)) {
 		struct stat st;
@@ -2798,7 +2790,6 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
 	if (fd &lt; 0)
 		return -1;
 
-	strbuf_init(&amp;nbuf, 0);
 	if (convert_to_working_tree(path, buf, size, &amp;nbuf)) {
 		size = nbuf.len;
 		buf  = nbuf.buf;
@@ -3060,13 +3051,12 @@ static void prefix_patches(struct patch *p)
 static int apply_patch(int fd, const char *filename, int options)
 {
 	size_t offset;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	struct patch *list = NULL, **listp = &amp;list;
 	int skipped_patch = 0;
 
 	/* FIXME - memory leak when using multiple patch files as inputs */
 	memset(&amp;fn_table, 0, sizeof(struct string_list));
-	strbuf_init(&amp;buf, 0);
 	patch_input_file = filename;
 	read_patch_file(&amp;buf, fd);
 	offset = 0;</diff>
      <filename>builtin-apply.c</filename>
    </modified>
    <modified>
      <diff>@@ -2062,7 +2062,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
 	struct commit *commit;
 	struct origin *origin;
 	unsigned char head_sha1[20];
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	const char *ident;
 	time_t now;
 	int size, len;
@@ -2082,7 +2082,6 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
 
 	origin = make_origin(commit, path);
 
-	strbuf_init(&amp;buf, 0);
 	if (!contents_from || strcmp(&quot;-&quot;, contents_from)) {
 		struct stat st;
 		const char *read_from;</diff>
      <filename>builtin-blame.c</filename>
    </modified>
    <modified>
      <diff>@@ -334,11 +334,10 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
 	}
 
 	if (verbose) {
-		struct strbuf subject;
+		struct strbuf subject = STRBUF_INIT;
 		const char *sub = &quot; **** invalid ref ****&quot;;
 		char stat[128];
 
-		strbuf_init(&amp;subject, 0);
 		stat[0] = '\0';
 
 		commit = item-&gt;commit;</diff>
      <filename>builtin-branch.c</filename>
    </modified>
    <modified>
      <diff>@@ -189,9 +189,8 @@ static int batch_one_object(const char *obj_name, int print_contents)
 
 static int batch_objects(int print_contents)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 
-	strbuf_init(&amp;buf, 0);
 	while (strbuf_getline(&amp;buf, stdin, '\n') != EOF) {
 		int error = batch_one_object(buf.buf, print_contents);
 		if (error)</diff>
      <filename>builtin-cat-file.c</filename>
    </modified>
    <modified>
      <diff>@@ -268,13 +268,11 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
 	}
 
 	if (read_from_stdin) {
-		struct strbuf buf, nbuf;
+		struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
 
 		if (all)
 			die(&quot;git checkout-index: don't mix '--all' and '--stdin'&quot;);
 
-		strbuf_init(&amp;buf, 0);
-		strbuf_init(&amp;nbuf, 0);
 		while (strbuf_getline(&amp;buf, stdin, line_termination) != EOF) {
 			const char *p;
 			if (line_termination &amp;&amp; buf.buf[0] == '&quot;') {</diff>
      <filename>builtin-checkout-index.c</filename>
    </modified>
    <modified>
      <diff>@@ -310,8 +310,7 @@ static void show_local_changes(struct object *head)
 
 static void describe_detached_head(char *msg, struct commit *commit)
 {
-	struct strbuf sb;
-	strbuf_init(&amp;sb, 0);
+	struct strbuf sb = STRBUF_INIT;
 	parse_commit(commit);
 	pretty_print_commit(CMIT_FMT_ONELINE, commit, &amp;sb, 0, NULL, NULL, 0, 0);
 	fprintf(stderr, &quot;%s %s... %s\n&quot;, msg,
@@ -360,8 +359,7 @@ struct branch_info {
 
 static void setup_branch_path(struct branch_info *branch)
 {
-	struct strbuf buf;
-	strbuf_init(&amp;buf, 0);
+	struct strbuf buf = STRBUF_INIT;
 	strbuf_addstr(&amp;buf, &quot;refs/heads/&quot;);
 	strbuf_addstr(&amp;buf, branch-&gt;name);
 	branch-&gt;path = strbuf_detach(&amp;buf, NULL);
@@ -484,7 +482,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 				   struct branch_info *old,
 				   struct branch_info *new)
 {
-	struct strbuf msg;
+	struct strbuf msg = STRBUF_INIT;
 	const char *old_desc;
 	if (opts-&gt;new_branch) {
 		create_branch(old-&gt;name, opts-&gt;new_branch, new-&gt;name, 0,
@@ -493,7 +491,6 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 		setup_branch_path(new);
 	}
 
-	strbuf_init(&amp;msg, 0);
 	old_desc = old-&gt;name;
 	if (!old_desc)
 		old_desc = sha1_to_hex(old-&gt;commit-&gt;object.sha1);
@@ -738,8 +735,7 @@ no_reference:
 	}
 
 	if (opts.new_branch) {
-		struct strbuf buf;
-		strbuf_init(&amp;buf, 0);
+		struct strbuf buf = STRBUF_INIT;
 		strbuf_addstr(&amp;buf, &quot;refs/heads/&quot;);
 		strbuf_addstr(&amp;buf, opts.new_branch);
 		if (!get_sha1(buf.buf, rev))</diff>
      <filename>builtin-checkout.c</filename>
    </modified>
    <modified>
      <diff>@@ -31,11 +31,11 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	int i;
 	int show_only = 0, remove_directories = 0, quiet = 0, ignored = 0;
 	int ignored_only = 0, baselen = 0, config_set = 0, errors = 0;
-	struct strbuf directory;
+	struct strbuf directory = STRBUF_INIT;
 	struct dir_struct dir;
 	const char *path, *base;
 	static const char **pathspec;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	const char *qname;
 	char *seen = NULL;
 	struct option options[] = {
@@ -58,7 +58,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 
 	argc = parse_options(argc, argv, options, builtin_clean_usage, 0);
 
-	strbuf_init(&amp;buf, 0);
 	memset(&amp;dir, 0, sizeof(dir));
 	if (ignored_only)
 		dir.show_ignored = 1;
@@ -88,7 +87,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	if (baselen)
 		path = base = xmemdupz(*pathspec, baselen);
 	read_directory(&amp;dir, path, base, baselen, pathspec);
-	strbuf_init(&amp;directory, 0);
 
 	if (pathspec)
 		seen = xmalloc(argc &gt; 0 ? argc : 1);</diff>
      <filename>builtin-clean.c</filename>
    </modified>
    <modified>
      <diff>@@ -264,10 +264,9 @@ pid_t junk_pid;
 
 static void remove_junk(void)
 {
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 	if (getpid() != junk_pid)
 		return;
-	strbuf_init(&amp;sb, 0);
 	if (junk_git_dir) {
 		strbuf_addstr(&amp;sb, junk_git_dir);
 		remove_dir_recursively(&amp;sb, 0);
@@ -354,7 +353,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	char *path, *dir;
 	const struct ref *refs, *head_points_at, *remote_head, *mapped_refs;
 	char branch_top[256], key[256], value[256];
-	struct strbuf reflog_msg;
+	struct strbuf reflog_msg = STRBUF_INIT;
 	struct transport *transport = NULL;
 	char *src_ref_prefix = &quot;refs/heads/&quot;;
 
@@ -404,7 +403,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (!stat(dir, &amp;buf))
 		die(&quot;destination directory '%s' already exists.&quot;, dir);
 
-	strbuf_init(&amp;reflog_msg, 0);
 	strbuf_addf(&amp;reflog_msg, &quot;clone: from %s&quot;, repo);
 
 	if (option_bare)
@@ -526,7 +524,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		create_symref(&quot;HEAD&quot;, head_points_at-&gt;name, NULL);
 
 		if (!option_bare) {
-			struct strbuf head_ref;
+			struct strbuf head_ref = STRBUF_INIT;
 			const char *head = head_points_at-&gt;name;
 
 			if (!prefixcmp(head, &quot;refs/heads/&quot;))
@@ -539,7 +537,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 				   head_points_at-&gt;old_sha1,
 				   NULL, 0, DIE_ON_ERR);
 
-			strbuf_init(&amp;head_ref, 0);
 			strbuf_addstr(&amp;head_ref, branch_top);
 			strbuf_addstr(&amp;head_ref, &quot;HEAD&quot;);
 </diff>
      <filename>builtin-clone.c</filename>
    </modified>
    <modified>
      <diff>@@ -448,7 +448,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 {
 	struct stat statbuf;
 	int commitable, saved_color_setting;
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 	char *buffer;
 	FILE *fp;
 	const char *hook_arg1 = NULL;
@@ -458,7 +458,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 	if (!no_verify &amp;&amp; run_hook(index_file, &quot;pre-commit&quot;, NULL))
 		return 0;
 
-	strbuf_init(&amp;sb, 0);
 	if (message.len) {
 		strbuf_addbuf(&amp;sb, &amp;message);
 		hook_arg1 = &quot;message&quot;;
@@ -511,10 +510,9 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 		stripspace(&amp;sb, 0);
 
 	if (signoff) {
-		struct strbuf sob;
+		struct strbuf sob = STRBUF_INIT;
 		int i;
 
-		strbuf_init(&amp;sob, 0);
 		strbuf_addstr(&amp;sob, sign_off_header);
 		strbuf_addstr(&amp;sob, fmt_name(getenv(&quot;GIT_COMMITTER_NAME&quot;),
 					     getenv(&quot;GIT_COMMITTER_EMAIL&quot;)));
@@ -672,7 +670,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
  */
 static int message_is_empty(struct strbuf *sb)
 {
-	struct strbuf tmpl;
+	struct strbuf tmpl = STRBUF_INIT;
 	const char *nl;
 	int eol, i, start = 0;
 
@@ -680,7 +678,6 @@ static int message_is_empty(struct strbuf *sb)
 		return 0;
 
 	/* See if the template is just a prefix of the message. */
-	strbuf_init(&amp;tmpl, 0);
 	if (template_file &amp;&amp; strbuf_read_file(&amp;tmpl, template_file, 0) &gt; 0) {
 		stripspace(&amp;tmpl, cleanup_mode == CLEANUP_ALL);
 		if (start + tmpl.len &lt;= sb-&gt;len &amp;&amp;
@@ -931,7 +928,7 @@ static const char commit_utf8_warn[] =
 
 int cmd_commit(int argc, const char **argv, const char *prefix)
 {
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 	const char *index_file, *reflog_msg;
 	char *nl, *p;
 	unsigned char commit_sha1[20];
@@ -966,12 +963,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		for (c = commit-&gt;parents; c; c = c-&gt;next)
 			pptr = &amp;commit_list_insert(c-&gt;item, pptr)-&gt;next;
 	} else if (in_merge) {
-		struct strbuf m;
+		struct strbuf m = STRBUF_INIT;
 		FILE *fp;
 
 		reflog_msg = &quot;commit (merge)&quot;;
 		pptr = &amp;commit_list_insert(lookup_commit(head_sha1), pptr)-&gt;next;
-		strbuf_init(&amp;m, 0);
 		fp = fopen(git_path(&quot;MERGE_HEAD&quot;), &quot;r&quot;);
 		if (fp == NULL)
 			die(&quot;could not open %s for reading: %s&quot;,
@@ -991,7 +987,6 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	parents = reduce_heads(parents);
 
 	/* Finally, get the commit message */
-	strbuf_init(&amp;sb, 0);
 	if (strbuf_read_file(&amp;sb, git_path(commit_editmsg), 0) &lt; 0) {
 		rollback_index_files();
 		die(&quot;could not read commit message&quot;);</diff>
      <filename>builtin-commit.c</filename>
    </modified>
    <modified>
      <diff>@@ -5,8 +5,7 @@
 
 static char *get_stdin(void)
 {
-	struct strbuf buf;
-	strbuf_init(&amp;buf, 0);
+	struct strbuf buf = STRBUF_INIT;
 	if (strbuf_read(&amp;buf, 0, 1024) &lt; 0) {
 		die(&quot;error reading standard input: %s&quot;, strerror(errno));
 	}</diff>
      <filename>builtin-fetch--tool.c</filename>
    </modified>
    <modified>
      <diff>@@ -358,7 +358,7 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
 	};
 
 	FILE *in = stdin;
-	struct strbuf input, output;
+	struct strbuf input = STRBUF_INIT, output = STRBUF_INIT;
 	int ret;
 
 	git_config(fmt_merge_msg_config, NULL);
@@ -372,10 +372,8 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
 			die(&quot;cannot open %s&quot;, inpath);
 	}
 
-	strbuf_init(&amp;input, 0);
 	if (strbuf_read(&amp;input, fileno(in), 0) &lt; 0)
 		die(&quot;could not read input file %s&quot;, strerror(errno));
-	strbuf_init(&amp;output, 0);
 
 	ret = fmt_merge_msg(merge_summary, &amp;input, &amp;output);
 	if (ret)</diff>
      <filename>builtin-fmt-merge-msg.c</filename>
    </modified>
    <modified>
      <diff>@@ -322,11 +322,9 @@ static const char *cmd_to_page(const char *git_cmd)
 
 static void setup_man_path(void)
 {
-	struct strbuf new_path;
+	struct strbuf new_path = STRBUF_INIT;
 	const char *old_path = getenv(&quot;MANPATH&quot;);
 
-	strbuf_init(&amp;new_path, 0);
-
 	/* We should always put ':' after our path. If there is no
 	 * old_path, the ':' at the end will let 'man' to try
 	 * system-wide paths after ours to find the manual page. If</diff>
      <filename>builtin-help.c</filename>
    </modified>
    <modified>
      <diff>@@ -628,10 +628,9 @@ static void gen_message_id(struct rev_info *info, char *base)
 	const char *committer = git_committer_info(IDENT_WARN_ON_NO_NAME);
 	const char *email_start = strrchr(committer, '&lt;');
 	const char *email_end = strrchr(committer, '&gt;');
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	if (!email_start || !email_end || email_start &gt; email_end - 1)
 		die(&quot;Could not extract email from committer identity.&quot;);
-	strbuf_init(&amp;buf, 0);
 	strbuf_addf(&amp;buf, &quot;%s.%lu.git.%.*s&quot;, base,
 		    (unsigned long) time(NULL),
 		    (int)(email_end - email_start - 1), email_start + 1);
@@ -650,7 +649,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 	const char *msg;
 	const char *extra_headers = rev-&gt;extra_headers;
 	struct shortlog log;
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 	int i;
 	const char *encoding = &quot;utf-8&quot;;
 	struct diff_options opts;
@@ -671,7 +670,6 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 	committer = git_committer_info(0);
 
 	msg = body;
-	strbuf_init(&amp;sb, 0);
 	pp_user_info(NULL, CMIT_FMT_EMAIL, &amp;sb, committer, DATE_RFC2822,
 		     encoding);
 	pp_title_line(CMIT_FMT_EMAIL, &amp;msg, &amp;sb, subject_start, extra_headers,
@@ -753,7 +751,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	const char *in_reply_to = NULL;
 	struct patch_ids ids;
 	char *add_signoff = NULL;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 
 	git_config(git_format_config, NULL);
 	init_revisions(&amp;rev, prefix);
@@ -861,8 +859,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	}
 	argc = j;
 
-	strbuf_init(&amp;buf, 0);
-
 	for (i = 0; i &lt; extra_hdr_nr; i++) {
 		strbuf_addstr(&amp;buf, extra_hdr[i]);
 		strbuf_addch(&amp;buf, '\n');
@@ -1139,8 +1135,7 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 			sign = '-';
 
 		if (verbose) {
-			struct strbuf buf;
-			strbuf_init(&amp;buf, 0);
+			struct strbuf buf = STRBUF_INIT;
 			pretty_print_commit(CMIT_FMT_ONELINE, commit,
 			                    &amp;buf, 0, NULL, NULL, 0, 0);
 			printf(&quot;%c %s %s\n&quot;, sign,</diff>
      <filename>builtin-log.c</filename>
    </modified>
    <modified>
      <diff>@@ -226,7 +226,7 @@ static void reset_hard(unsigned const char *sha1, int verbose)
 
 static void restore_state(void)
 {
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 	const char *args[] = { &quot;stash&quot;, &quot;apply&quot;, NULL, NULL };
 
 	if (is_null_sha1(stash))
@@ -234,7 +234,6 @@ static void restore_state(void)
 
 	reset_hard(head, 1);
 
-	strbuf_init(&amp;sb, 0);
 	args[2] = sha1_to_hex(stash);
 
 	/*
@@ -258,7 +257,7 @@ static void squash_message(void)
 {
 	struct rev_info rev;
 	struct commit *commit;
-	struct strbuf out;
+	struct strbuf out = STRBUF_INIT;
 	struct commit_list *j;
 	int fd;
 
@@ -282,7 +281,6 @@ static void squash_message(void)
 	if (prepare_revision_walk(&amp;rev))
 		die(&quot;revision walk setup failed&quot;);
 
-	strbuf_init(&amp;out, 0);
 	strbuf_addstr(&amp;out, &quot;Squashed commit of the following:\n&quot;);
 	while ((commit = get_revision(&amp;rev)) != NULL) {
 		strbuf_addch(&amp;out, '\n');
@@ -327,9 +325,8 @@ static int run_hook(const char *name)
 
 static void finish(const unsigned char *new_head, const char *msg)
 {
-	struct strbuf reflog_message;
+	struct strbuf reflog_message = STRBUF_INIT;
 
-	strbuf_init(&amp;reflog_message, 0);
 	if (!msg)
 		strbuf_addstr(&amp;reflog_message, getenv(&quot;GIT_REFLOG_ACTION&quot;));
 	else {
@@ -380,7 +377,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
 {
 	struct object *remote_head;
 	unsigned char branch_head[20], buf_sha[20];
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	const char *ptr;
 	int len, early;
 
@@ -389,7 +386,6 @@ static void merge_name(const char *remote, struct strbuf *msg)
 	if (!remote_head)
 		die(&quot;'%s' does not point to a commit&quot;, remote);
 
-	strbuf_init(&amp;buf, 0);
 	strbuf_addstr(&amp;buf, &quot;refs/heads/&quot;);
 	strbuf_addstr(&amp;buf, remote);
 	resolve_ref(buf.buf, branch_head, 0, 0);
@@ -444,10 +440,9 @@ static void merge_name(const char *remote, struct strbuf *msg)
 	if (!strcmp(remote, &quot;FETCH_HEAD&quot;) &amp;&amp;
 			!access(git_path(&quot;FETCH_HEAD&quot;), R_OK)) {
 		FILE *fp;
-		struct strbuf line;
+		struct strbuf line = STRBUF_INIT;
 		char *ptr;
 
-		strbuf_init(&amp;line, 0);
 		fp = fopen(git_path(&quot;FETCH_HEAD&quot;), &quot;r&quot;);
 		if (!fp)
 			die(&quot;could not open %s for reading: %s&quot;,
@@ -545,7 +540,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 	const char **args;
 	int i = 0, ret;
 	struct commit_list *j;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	int index_fd;
 	struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
 
@@ -592,7 +587,6 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
 	} else {
 		args = xmalloc((4 + commit_list_count(common) +
 					commit_list_count(remoteheads)) * sizeof(char *));
-		strbuf_init(&amp;buf, 0);
 		strbuf_addf(&amp;buf, &quot;merge-%s&quot;, strategy);
 		args[i++] = buf.buf;
 		for (j = common; j; j = j-&gt;next)
@@ -847,7 +841,7 @@ static int evaluate_result(void)
 int cmd_merge(int argc, const char **argv, const char *prefix)
 {
 	unsigned char result_tree[20];
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	const char *head_arg;
 	int flag, head_invalid = 0, i;
 	int best_cnt = -1, merge_was_ok = 0, automerge_was_ok = 0;
@@ -896,7 +890,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	 * Traditional format never would have &quot;-m&quot; so it is an
 	 * additional safety measure to check for it.
 	 */
-	strbuf_init(&amp;buf, 0);
 
 	if (!have_message &amp;&amp; is_old_style_invocation(argc, argv)) {
 		strbuf_addstr(&amp;merge_msg, argv[0]);
@@ -926,7 +919,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		reset_hard(remote_head-&gt;sha1, 0);
 		return 0;
 	} else {
-		struct strbuf msg;
+		struct strbuf msg = STRBUF_INIT;
 
 		/* We are invoked directly as the first-class UI. */
 		head_arg = &quot;HEAD&quot;;
@@ -939,7 +932,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		 * codepath so we discard the error in this
 		 * loop.
 		 */
-		strbuf_init(&amp;msg, 0);
 		for (i = 0; i &lt; argc; i++)
 			merge_name(argv[i], &amp;msg);
 		fmt_merge_msg(option_log, &amp;msg, &amp;merge_msg);
@@ -1014,7 +1006,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 			!common-&gt;next &amp;&amp;
 			!hashcmp(common-&gt;item-&gt;object.sha1, head)) {
 		/* Again the most common case of merging one remote. */
-		struct strbuf msg;
+		struct strbuf msg = STRBUF_INIT;
 		struct object *o;
 		char hex[41];
 
@@ -1024,7 +1016,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 			hex,
 			find_unique_abbrev(remoteheads-&gt;item-&gt;object.sha1,
 			DEFAULT_ABBREV));
-		strbuf_init(&amp;msg, 0);
 		strbuf_addstr(&amp;msg, &quot;Fast forward&quot;);
 		if (have_message)
 			strbuf_addstr(&amp;msg,</diff>
      <filename>builtin-merge.c</filename>
    </modified>
    <modified>
      <diff>@@ -54,7 +54,7 @@ static int add(int argc, const char **argv)
 	struct string_list track = { NULL, 0, 0 };
 	const char *master = NULL;
 	struct remote *remote;
-	struct strbuf buf, buf2;
+	struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
 	const char *name, *url;
 	int i;
 
@@ -81,9 +81,6 @@ static int add(int argc, const char **argv)
 			remote-&gt;fetch_refspec_nr))
 		die(&quot;remote %s already exists.&quot;, name);
 
-	strbuf_init(&amp;buf, 0);
-	strbuf_init(&amp;buf2, 0);
-
 	strbuf_addf(&amp;buf2, &quot;refs/heads/test:refs/remotes/%s/test&quot;, name);
 	if (!valid_fetch_refspec(buf2.buf))
 		die(&quot;'%s' is not a valid remote name&quot;, name);
@@ -352,7 +349,7 @@ static int rm(int argc, const char **argv)
 		OPT_END()
 	};
 	struct remote *remote;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	struct known_remotes known_remotes = { NULL, NULL };
 	struct string_list branches = { NULL, 0, 0, 1 };
 	struct branches_for_remote cb_data = { NULL, &amp;branches, &amp;known_remotes };
@@ -368,7 +365,6 @@ static int rm(int argc, const char **argv)
 	known_remotes.to_delete = remote;
 	for_each_remote(add_known_remote, &amp;known_remotes);
 
-	strbuf_init(&amp;buf, 0);
 	strbuf_addf(&amp;buf, &quot;remote.%s&quot;, remote-&gt;name);
 	if (git_config_rename_section(buf.buf, NULL) &lt; 1)
 		return error(&quot;Could not remove config section '%s'&quot;, buf.buf);</diff>
      <filename>builtin-remote.c</filename>
    </modified>
    <modified>
      <diff>@@ -107,8 +107,7 @@ static void show_commit(struct commit *commit)
 		putchar('\n');
 
 	if (revs.verbose_header &amp;&amp; commit-&gt;buffer) {
-		struct strbuf buf;
-		strbuf_init(&amp;buf, 0);
+		struct strbuf buf = STRBUF_INIT;
 		pretty_print_commit(revs.commit_format, commit,
 				    &amp;buf, revs.abbrev, NULL, NULL,
 				    revs.date_mode, 0);</diff>
      <filename>builtin-rev-list.c</filename>
    </modified>
    <modified>
      <diff>@@ -307,19 +307,17 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
 		OPT_END(),
 	};
 
-	struct strbuf sb, parsed;
+	struct strbuf sb = STRBUF_INIT, parsed = STRBUF_INIT;
 	const char **usage = NULL;
 	struct option *opts = NULL;
 	int onb = 0, osz = 0, unb = 0, usz = 0;
 
-	strbuf_init(&amp;parsed, 0);
 	strbuf_addstr(&amp;parsed, &quot;set --&quot;);
 	argc = parse_options(argc, argv, parseopt_opts, parseopt_usage,
 	                     PARSE_OPT_KEEP_DASHDASH);
 	if (argc &lt; 1 || strcmp(argv[0], &quot;--&quot;))
 		usage_with_options(parseopt_usage, parseopt_opts);
 
-	strbuf_init(&amp;sb, 0);
 	/* get the usage up to the first line with a -- on it */
 	for (;;) {
 		if (strbuf_getline(&amp;sb, stdin, '\n') == EOF)</diff>
      <filename>builtin-rev-parse.c</filename>
    </modified>
    <modified>
      <diff>@@ -259,11 +259,10 @@ static void join_revs(struct commit_list **list_p,
 
 static void show_one_commit(struct commit *commit, int no_name)
 {
-	struct strbuf pretty;
+	struct strbuf pretty = STRBUF_INIT;
 	const char *pretty_str = &quot;(unavailable)&quot;;
 	struct commit_name *name = commit-&gt;util;
 
-	strbuf_init(&amp;pretty, 0);
 	if (commit-&gt;object.parsed) {
 		pretty_print_commit(CMIT_FMT_ONELINE, commit,
 				    &amp;pretty, 0, NULL, NULL, 0, 0);</diff>
      <filename>builtin-show-branch.c</filename>
    </modified>
    <modified>
      <diff>@@ -70,14 +70,13 @@ void stripspace(struct strbuf *sb, int skip_comments)
 
 int cmd_stripspace(int argc, const char **argv, const char *prefix)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	int strip_comments = 0;
 
 	if (argc &gt; 1 &amp;&amp; (!strcmp(argv[1], &quot;-s&quot;) ||
 				!strcmp(argv[1], &quot;--strip-comments&quot;)))
 		strip_comments = 1;
 
-	strbuf_init(&amp;buf, 0);
 	if (strbuf_read(&amp;buf, 0, 1024) &lt; 0)
 		die(&quot;could not read the input&quot;);
 </diff>
      <filename>builtin-stripspace.c</filename>
    </modified>
    <modified>
      <diff>@@ -338,7 +338,7 @@ static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
 
 int cmd_tag(int argc, const char **argv, const char *prefix)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	unsigned char object[20], prev[20];
 	char ref[PATH_MAX];
 	const char *object_ref, *tag;
@@ -388,7 +388,6 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 	if (verify)
 		return for_each_tag_name(argv, verify_tag);
 
-	strbuf_init(&amp;buf, 0);
 	if (msg.given || msgfile) {
 		if (msg.given &amp;&amp; msgfile)
 			die(&quot;only one -F or -m option is allowed.&quot;);</diff>
      <filename>builtin-tag.c</filename>
    </modified>
    <modified>
      <diff>@@ -297,11 +297,9 @@ static void update_one(const char *path, const char *prefix, int prefix_length)
 
 static void read_index_info(int line_termination)
 {
-	struct strbuf buf;
-	struct strbuf uq;
+	struct strbuf buf = STRBUF_INIT;
+	struct strbuf uq = STRBUF_INIT;
 
-	strbuf_init(&amp;buf, 0);
-	strbuf_init(&amp;uq, 0);
 	while (strbuf_getline(&amp;buf, stdin, line_termination) != EOF) {
 		char *ptr, *tab;
 		char *path_name;
@@ -717,10 +715,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 			free((char*)p);
 	}
 	if (read_from_stdin) {
-		struct strbuf buf, nbuf;
+		struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
 
-		strbuf_init(&amp;buf, 0);
-		strbuf_init(&amp;nbuf, 0);
 		setup_work_tree();
 		while (strbuf_getline(&amp;buf, stdin, line_termination) != EOF) {
 			const char *p;</diff>
      <filename>builtin-update-index.c</filename>
    </modified>
    <modified>
      <diff>@@ -742,9 +742,8 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
 
 			/* If not a fake symlink, apply filters, e.g. autocrlf */
 			if (is_file) {
-				struct strbuf buf;
+				struct strbuf buf = STRBUF_INIT;
 
-				strbuf_init(&amp;buf, 0);
 				if (convert_to_git(elem-&gt;path, result, len, &amp;buf, safe_crlf)) {
 					free(result);
 					result = strbuf_detach(&amp;buf, &amp;len);</diff>
      <filename>combine-diff.c</filename>
    </modified>
    <modified>
      <diff>@@ -753,9 +753,8 @@ static int store_write_section(int fd, const char* key)
 {
 	const char *dot;
 	int i, success;
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 
-	strbuf_init(&amp;sb, 0);
 	dot = memchr(key, '.', store.baselen);
 	if (dot) {
 		strbuf_addf(&amp;sb, &quot;[%.*s \&quot;&quot;, (int)(dot - key), key);
@@ -780,7 +779,7 @@ static int store_write_pair(int fd, const char* key, const char* value)
 	int i, success;
 	int length = strlen(key + store.baselen + 1);
 	const char *quote = &quot;&quot;;
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 
 	/*
 	 * Check to see if the value needs to be surrounded with a dq pair.
@@ -797,7 +796,6 @@ static int store_write_pair(int fd, const char* key, const char* value)
 	if (i &amp;&amp; value[i - 1] == ' ')
 		quote = &quot;\&quot;&quot;;
 
-	strbuf_init(&amp;sb, 0);
 	strbuf_addf(&amp;sb, &quot;\t%.*s = %s&quot;,
 		    length, key + store.baselen + 1, quote);
 </diff>
      <filename>config.c</filename>
    </modified>
    <modified>
      <diff>@@ -281,7 +281,7 @@ static int apply_filter(const char *path, const char *src, size_t len,
 	 * (child --&gt; cmd) --&gt; us
 	 */
 	int ret = 1;
-	struct strbuf nbuf;
+	struct strbuf nbuf = STRBUF_INIT;
 	struct async async;
 	struct filter_params params;
 
@@ -299,7 +299,6 @@ static int apply_filter(const char *path, const char *src, size_t len,
 	if (start_async(&amp;async))
 		return 0;	/* error was already reported */
 
-	strbuf_init(&amp;nbuf, 0);
 	if (strbuf_read(&amp;nbuf, async.out, len) &lt; 0) {
 		error(&quot;read from external filter %s failed&quot;, cmd);
 		ret = 0;</diff>
      <filename>convert.c</filename>
    </modified>
    <modified>
      <diff>@@ -217,9 +217,8 @@ static char *quote_two(const char *one, const char *two)
 {
 	int need_one = quote_c_style(one, NULL, NULL, 1);
 	int need_two = quote_c_style(two, NULL, NULL, 1);
-	struct strbuf res;
+	struct strbuf res = STRBUF_INIT;
 
-	strbuf_init(&amp;res, 0);
 	if (need_one + need_two) {
 		strbuf_addch(&amp;res, '&quot;');
 		quote_c_style(one, &amp;res, NULL, 1);
@@ -683,7 +682,7 @@ static char *pprint_rename(const char *a, const char *b)
 {
 	const char *old = a;
 	const char *new = b;
-	struct strbuf name;
+	struct strbuf name = STRBUF_INIT;
 	int pfx_length, sfx_length;
 	int len_a = strlen(a);
 	int len_b = strlen(b);
@@ -691,7 +690,6 @@ static char *pprint_rename(const char *a, const char *b)
 	int qlen_a = quote_c_style(a, NULL, NULL, 0);
 	int qlen_b = quote_c_style(b, NULL, NULL, 0);
 
-	strbuf_init(&amp;name, 0);
 	if (qlen_a || qlen_b) {
 		quote_c_style(a, &amp;name, NULL, 0);
 		strbuf_addstr(&amp;name, &quot; =&gt; &quot;);
@@ -834,8 +832,7 @@ static void fill_print_name(struct diffstat_file *file)
 		return;
 
 	if (!file-&gt;is_renamed) {
-		struct strbuf buf;
-		strbuf_init(&amp;buf, 0);
+		struct strbuf buf = STRBUF_INIT;
 		if (quote_c_style(file-&gt;name, &amp;buf, NULL, 0)) {
 			pname = strbuf_detach(&amp;buf, NULL);
 		} else {
@@ -1820,10 +1817,9 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int
 
 static int populate_from_stdin(struct diff_filespec *s)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	size_t size = 0;
 
-	strbuf_init(&amp;buf, 0);
 	if (strbuf_read(&amp;buf, 0, 0) &lt; 0)
 		return error(&quot;error while reading from stdin %s&quot;,
 				     strerror(errno));
@@ -1875,7 +1871,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 
 	if (!s-&gt;sha1_valid ||
 	    reuse_worktree_file(s-&gt;path, s-&gt;sha1, 0)) {
-		struct strbuf buf;
+		struct strbuf buf = STRBUF_INIT;
 		struct stat st;
 		int fd;
 
@@ -1918,7 +1914,6 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 		/*
 		 * Convert from working tree format to canonical git format
 		 */
-		strbuf_init(&amp;buf, 0);
 		if (convert_to_git(s-&gt;path, s-&gt;data, s-&gt;size, &amp;buf, safe_crlf)) {
 			size_t size = 0;
 			munmap(s-&gt;data, s-&gt;size);</diff>
      <filename>diff.c</filename>
    </modified>
    <modified>
      <diff>@@ -26,9 +26,8 @@ int launch_editor(const char *path, struct strbuf *buffer, const char *const *en
 		int i = 0;
 		int failed;
 		const char *args[6];
-		struct strbuf arg0;
+		struct strbuf arg0 = STRBUF_INIT;
 
-		strbuf_init(&amp;arg0, 0);
 		if (strcspn(editor, &quot;$ \t'&quot;) != len) {
 			/* there are specials */
 			strbuf_addf(&amp;arg0, &quot;%s \&quot;$@\&quot;&quot;, editor);</diff>
      <filename>editor.c</filename>
    </modified>
    <modified>
      <diff>@@ -59,9 +59,7 @@ static void add_path(struct strbuf *out, const char *path)
 void setup_path(void)
 {
 	const char *old_path = getenv(&quot;PATH&quot;);
-	struct strbuf new_path;
-
-	strbuf_init(&amp;new_path, 0);
+	struct strbuf new_path = STRBUF_INIT;
 
 	add_path(&amp;new_path, argv_exec_path);
 	add_path(&amp;new_path, getenv(EXEC_PATH_ENVIRONMENT));</diff>
      <filename>exec_cmd.c</filename>
    </modified>
    <modified>
      <diff>@@ -307,9 +307,8 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
 {
 	va_list ap;
 	int len;
-	struct strbuf sb;
+	struct strbuf sb = STRBUF_INIT;
 
-	strbuf_init(&amp;sb, 0);
 	strbuf_addf(&amp;sb, &quot;object %s:&quot;, obj-&gt;sha1?sha1_to_hex(obj-&gt;sha1):&quot;(null)&quot;);
 
 	va_start(ap, fmt);</diff>
      <filename>fsck.c</filename>
    </modified>
    <modified>
      <diff>@@ -389,10 +389,9 @@ static void handle_internal_command(int argc, const char **argv)
 
 static void execv_dashed_external(const char **argv)
 {
-	struct strbuf cmd;
+	struct strbuf cmd = STRBUF_INIT;
 	const char *tmp;
 
-	strbuf_init(&amp;cmd, 0);
 	strbuf_addf(&amp;cmd, &quot;git-%s&quot;, argv[0]);
 
 	/*</diff>
      <filename>git.c</filename>
    </modified>
    <modified>
      <diff>@@ -1010,14 +1010,12 @@ int graph_is_commit_finished(struct git_graph const *graph)
 
 void graph_show_commit(struct git_graph *graph)
 {
-	struct strbuf msgbuf;
+	struct strbuf msgbuf = STRBUF_INIT;
 	int shown_commit_line = 0;
 
 	if (!graph)
 		return;
 
-	strbuf_init(&amp;msgbuf, 0);
-
 	while (!shown_commit_line) {
 		shown_commit_line = graph_next_line(graph, &amp;msgbuf);
 		fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
@@ -1031,12 +1029,11 @@ void graph_show_commit(struct git_graph *graph)
 
 void graph_show_oneline(struct git_graph *graph)
 {
-	struct strbuf msgbuf;
+	struct strbuf msgbuf = STRBUF_INIT;
 
 	if (!graph)
 		return;
 
-	strbuf_init(&amp;msgbuf, 0);
 	graph_next_line(graph, &amp;msgbuf);
 	fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
 	strbuf_release(&amp;msgbuf);
@@ -1044,12 +1041,11 @@ void graph_show_oneline(struct git_graph *graph)
 
 void graph_show_padding(struct git_graph *graph)
 {
-	struct strbuf msgbuf;
+	struct strbuf msgbuf = STRBUF_INIT;
 
 	if (!graph)
 		return;
 
-	strbuf_init(&amp;msgbuf, 0);
 	graph_padding_line(graph, &amp;msgbuf);
 	fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
 	strbuf_release(&amp;msgbuf);
@@ -1057,7 +1053,7 @@ void graph_show_padding(struct git_graph *graph)
 
 int graph_show_remainder(struct git_graph *graph)
 {
-	struct strbuf msgbuf;
+	struct strbuf msgbuf = STRBUF_INIT;
 	int shown = 0;
 
 	if (!graph)
@@ -1066,7 +1062,6 @@ int graph_show_remainder(struct git_graph *graph)
 	if (graph_is_commit_finished(graph))
 		return 0;
 
-	strbuf_init(&amp;msgbuf, 0);
 	for (;;) {
 		graph_next_line(graph, &amp;msgbuf);
 		fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);</diff>
      <filename>graph.c</filename>
    </modified>
    <modified>
      <diff>@@ -34,10 +34,8 @@ static void hash_object(const char *path, const char *type, int write_object,
 
 static void hash_stdin_paths(const char *type, int write_objects)
 {
-	struct strbuf buf, nbuf;
+	struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
 
-	strbuf_init(&amp;buf, 0);
-	strbuf_init(&amp;nbuf, 0);
 	while (strbuf_getline(&amp;buf, stdin, '\n') != EOF) {
 		if (buf.buf[0] == '&quot;') {
 			strbuf_reset(&amp;nbuf);</diff>
      <filename>hash-object.c</filename>
    </modified>
    <modified>
      <diff>@@ -1266,10 +1266,9 @@ static int imap_store_msg(struct store *gctx, struct msg_data *data, int *uid)
 
 static int read_message(FILE *f, struct msg_data *msg)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 
 	memset(msg, 0, sizeof(*msg));
-	strbuf_init(&amp;buf, 0);
 
 	do {
 		if (strbuf_fread(&amp;buf, CHUNKSIZE, f) &lt;= 0)</diff>
      <filename>imap-send.c</filename>
    </modified>
    <modified>
      <diff>@@ -252,7 +252,7 @@ void log_write_email_headers(struct rev_info *opt, const char *name,
 
 void show_log(struct rev_info *opt)
 {
-	struct strbuf msgbuf;
+	struct strbuf msgbuf = STRBUF_INIT;
 	struct log_info *log = opt-&gt;loginfo;
 	struct commit *commit = log-&gt;commit, *parent = log-&gt;parent;
 	int abbrev = opt-&gt;diffopt.abbrev;
@@ -381,7 +381,6 @@ void show_log(struct rev_info *opt)
 	/*
 	 * And then the pretty-printed message itself
 	 */
-	strbuf_init(&amp;msgbuf, 0);
 	if (need_8bit_cte &gt;= 0)
 		need_8bit_cte = has_non_ascii(opt-&gt;add_signoff);
 	pretty_print_commit(opt-&gt;commit_format, commit, &amp;msgbuf,</diff>
      <filename>log-tree.c</filename>
    </modified>
    <modified>
      <diff>@@ -498,8 +498,7 @@ static void update_file_flags(struct merge_options *o,
 		if (type != OBJ_BLOB)
 			die(&quot;blob expected for %s '%s'&quot;, sha1_to_hex(sha), path);
 		if (S_ISREG(mode)) {
-			struct strbuf strbuf;
-			strbuf_init(&amp;strbuf, 0);
+			struct strbuf strbuf = STRBUF_INIT;
 			if (convert_to_working_tree(path, buf, size, &amp;strbuf)) {
 				free(buf);
 				size = strbuf.len;</diff>
      <filename>merge-recursive.c</filename>
    </modified>
    <modified>
      <diff>@@ -153,7 +153,7 @@ static int verify_tag(char *buffer, unsigned long size)
 
 int main(int argc, char **argv)
 {
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	unsigned char result_sha1[20];
 
 	if (argc != 1)
@@ -161,7 +161,6 @@ int main(int argc, char **argv)
 
 	setup_git_directory();
 
-	strbuf_init(&amp;buf, 0);
 	if (strbuf_read(&amp;buf, 0, 4096) &lt; 0) {
 		die(&quot;could not read from stdin&quot;);
 	}</diff>
      <filename>mktag.c</filename>
    </modified>
    <modified>
      <diff>@@ -65,8 +65,8 @@ static const char mktree_usage[] = &quot;git-mktree [-z]&quot;;
 
 int main(int ac, char **av)
 {
-	struct strbuf sb;
-	struct strbuf p_uq;
+	struct strbuf sb = STRBUF_INIT;
+	struct strbuf p_uq = STRBUF_INIT;
 	unsigned char sha1[20];
 	int line_termination = '\n';
 
@@ -82,8 +82,6 @@ int main(int ac, char **av)
 		av++;
 	}
 
-	strbuf_init(&amp;sb, 0);
-	strbuf_init(&amp;p_uq, 0);
 	while (strbuf_getline(&amp;sb, stdin, line_termination) != EOF) {
 		char *ptr, *ntr;
 		unsigned mode;</diff>
      <filename>mktree.c</filename>
    </modified>
    <modified>
      <diff>@@ -234,7 +234,7 @@ static char *get_header(const struct commit *commit, const char *key)
 
 static char *replace_encoding_header(char *buf, const char *encoding)
 {
-	struct strbuf tmp;
+	struct strbuf tmp = STRBUF_INIT;
 	size_t start, len;
 	char *cp = buf;
 
@@ -250,7 +250,6 @@ static char *replace_encoding_header(char *buf, const char *encoding)
 		return buf; /* should not happen but be defensive */
 	len = cp + 1 - (buf + start);
 
-	strbuf_init(&amp;tmp, 0);
 	strbuf_attach(&amp;tmp, buf, strlen(buf), strlen(buf) + 1);
 	if (is_encoding_utf8(encoding)) {
 		/* we have re-coded to UTF-8; drop the header */</diff>
      <filename>pretty.c</filename>
    </modified>
    <modified>
      <diff>@@ -1467,9 +1467,8 @@ int write_index(const struct index_state *istate, int newfd)
 
 	/* Write extension data here */
 	if (istate-&gt;cache_tree) {
-		struct strbuf sb;
+		struct strbuf sb = STRBUF_INIT;
 
-		strbuf_init(&amp;sb, 0);
 		cache_tree_write(&amp;sb, istate-&gt;cache_tree);
 		err = write_index_ext_header(&amp;c, newfd, CACHE_EXT_TREE, sb.len) &lt; 0
 			|| ce_write(&amp;c, newfd, sb.buf, sb.len) &lt; 0;</diff>
      <filename>read-cache.c</filename>
    </modified>
    <modified>
      <diff>@@ -245,7 +245,7 @@ static void read_branches_file(struct remote *remote)
 {
 	const char *slash = strchr(remote-&gt;name, '/');
 	char *frag;
-	struct strbuf branch;
+	struct strbuf branch = STRBUF_INIT;
 	int n = slash ? slash - remote-&gt;name : 1000;
 	FILE *f = fopen(git_path(&quot;branches/%.*s&quot;, n, remote-&gt;name), &quot;r&quot;);
 	char *s, *p;
@@ -283,7 +283,6 @@ static void read_branches_file(struct remote *remote)
 	 * #branch specified.  The &quot;master&quot; (or specified) branch is
 	 * fetched and stored in the local branch of the same name.
 	 */
-	strbuf_init(&amp;branch, 0);
 	frag = strchr(p, '#');
 	if (frag) {
 		*(frag++) = '\0';</diff>
      <filename>remote.c</filename>
    </modified>
    <modified>
      <diff>@@ -79,7 +79,7 @@ static int handle_file(const char *path,
 	enum {
 		RR_CONTEXT = 0, RR_SIDE_1, RR_SIDE_2, RR_ORIGINAL,
 	} hunk = RR_CONTEXT;
-	struct strbuf one, two;
+	struct strbuf one = STRBUF_INIT, two = STRBUF_INIT;
 	FILE *f = fopen(path, &quot;r&quot;);
 	FILE *out = NULL;
 
@@ -97,8 +97,6 @@ static int handle_file(const char *path,
 	if (sha1)
 		git_SHA1_Init(&amp;ctx);
 
-	strbuf_init(&amp;one, 0);
-	strbuf_init(&amp;two,  0);
 	while (fgets(buf, sizeof(buf), f)) {
 		if (!prefixcmp(buf, &quot;&lt;&lt;&lt;&lt;&lt;&lt;&lt; &quot;)) {
 			if (hunk != RR_CONTEXT)</diff>
      <filename>rerere.c</filename>
    </modified>
    <modified>
      <diff>@@ -2386,8 +2386,7 @@ static int index_mem(unsigned char *sha1, void *buf, size_t size,
 	 * Convert blobs to git internal format
 	 */
 	if ((type == OBJ_BLOB) &amp;&amp; path) {
-		struct strbuf nbuf;
-		strbuf_init(&amp;nbuf, 0);
+		struct strbuf nbuf = STRBUF_INIT;
 		if (convert_to_git(path, buf, size, &amp;nbuf,
 		                   write_object ? safe_crlf : 0)) {
 			buf = strbuf_detach(&amp;nbuf, &amp;size);
@@ -2411,8 +2410,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
 	size_t size = xsize_t(st-&gt;st_size);
 
 	if (!S_ISREG(st-&gt;st_mode)) {
-		struct strbuf sbuf;
-		strbuf_init(&amp;sbuf, 0);
+		struct strbuf sbuf = STRBUF_INIT;
 		if (strbuf_read(&amp;sbuf, fd, 4096) &gt;= 0)
 			ret = index_mem(sha1, sbuf.buf, sbuf.len, write_object,
 					type, path);</diff>
      <filename>sha1_file.c</filename>
    </modified>
    <modified>
      <diff>@@ -215,9 +215,8 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
 int walker_targets_stdin(char ***target, const char ***write_ref)
 {
 	int targets = 0, targets_alloc = 0;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 	*target = NULL; *write_ref = NULL;
-	strbuf_init(&amp;buf, 0);
 	while (1) {
 		char *rf_one = NULL;
 		char *tg_one;</diff>
      <filename>walker.c</filename>
    </modified>
    <modified>
      <diff>@@ -99,8 +99,7 @@ unsigned whitespace_rule(const char *pathname)
 /* The returned string should be freed by the caller. */
 char *whitespace_error_string(unsigned ws)
 {
-	struct strbuf err;
-	strbuf_init(&amp;err, 0);
+	struct strbuf err = STRBUF_INIT;
 	if (ws &amp; WS_TRAILING_SPACE)
 		strbuf_addstr(&amp;err, &quot;trailing whitespace&quot;);
 	if (ws &amp; WS_SPACE_BEFORE_TAB) {</diff>
      <filename>ws.c</filename>
    </modified>
    <modified>
      <diff>@@ -103,10 +103,8 @@ static void wt_status_print_filepair(struct wt_status *s,
 {
 	const char *c = color(t);
 	const char *one, *two;
-	struct strbuf onebuf, twobuf;
+	struct strbuf onebuf = STRBUF_INIT, twobuf = STRBUF_INIT;
 
-	strbuf_init(&amp;onebuf, 0);
-	strbuf_init(&amp;twobuf, 0);
 	one = quote_path(p-&gt;one-&gt;path, -1, &amp;onebuf, s-&gt;prefix);
 	two = quote_path(p-&gt;two-&gt;path, -1, &amp;twobuf, s-&gt;prefix);
 
@@ -190,9 +188,8 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,
 static void wt_status_print_initial(struct wt_status *s)
 {
 	int i;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 
-	strbuf_init(&amp;buf, 0);
 	if (active_nr) {
 		s-&gt;commitable = 1;
 		wt_status_print_cached_header(s);
@@ -268,9 +265,8 @@ static void wt_status_print_untracked(struct wt_status *s)
 	struct dir_struct dir;
 	int i;
 	int shown_header = 0;
-	struct strbuf buf;
+	struct strbuf buf = STRBUF_INIT;
 
-	strbuf_init(&amp;buf, 0);
 	memset(&amp;dir, 0, sizeof(dir));
 
 	if (!s-&gt;untracked) {</diff>
      <filename>wt-status.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7e7abea96b8140c592a46293f5e33aae0683c7ac</id>
    </parent>
  </parents>
  <author>
    <name>Brandon Casey</name>
    <email>casey@nrlssc.navy.mil</email>
  </author>
  <url>http://github.com/rtyler/slide-git/commit/f285a2d7ed6548666989406de8f0e7233eb84368</url>
  <id>f285a2d7ed6548666989406de8f0e7233eb84368</id>
  <committed-date>2008-10-12T12:36:19-07:00</committed-date>
  <authored-date>2008-10-09T12:12:12-07:00</authored-date>
  <message>Replace calls to strbuf_init(&amp;foo, 0) with STRBUF_INIT initializer

Many call sites use strbuf_init(&amp;foo, 0) to initialize local
strbuf variable &quot;foo&quot; which has not been accessed since its
declaration. These can be replaced with a static initialization
using the STRBUF_INIT macro which is just as readable, saves a
function call, and takes up fewer lines.

Signed-off-by: Brandon Casey &lt;casey@nrlssc.navy.mil&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;</message>
  <tree>2e422bd9ceeeb432ca03b61f91165790f0e37146</tree>
  <committer>
    <name>Shawn O. Pearce</name>
    <email>spearce@spearce.org</email>
  </committer>
</commit>
