Code

builtin-fetch.c (store_updated_refs): Honor update_local_ref() return value
[git.git] / builtin-commit-tree.c
index bc9502c13525759f92c39e77f18edbb355305ab1..e5e4bdbe862b23aafe932da411f597b0f3b5c997 100644 (file)
@@ -8,7 +8,6 @@
 #include "tree.h"
 #include "builtin.h"
 #include "utf8.h"
-#include "strbuf.h"
 
 #define BLOCKING (1ul << 14)
 
@@ -61,7 +60,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
        struct strbuf buffer;
        int encoding_is_utf8;
 
-       git_config(git_default_config);
+       git_config(git_default_config, NULL);
 
        if (argc < 2)
                usage(commit_tree_usage);
@@ -87,8 +86,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
        /* Not having i18n.commitencoding is the same as having utf-8 */
        encoding_is_utf8 = is_encoding_utf8(git_commit_encoding);
 
-       strbuf_init(&buffer);
-       strbuf_grow(&buffer, 8192); /* should avoid reallocs for the headers */
+       strbuf_init(&buffer, 8192); /* should avoid reallocs for the headers */
        strbuf_addf(&buffer, "tree %s\n", sha1_to_hex(tree_sha1));
 
        /*
@@ -100,14 +98,14 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
                strbuf_addf(&buffer, "parent %s\n", sha1_to_hex(parent_sha1[i]));
 
        /* Person/date information */
-       strbuf_addf(&buffer, "author %s\n", git_author_info(1));
-       strbuf_addf(&buffer, "committer %s\n", git_committer_info(1));
+       strbuf_addf(&buffer, "author %s\n", git_author_info(IDENT_ERROR_ON_NO_NAME));
+       strbuf_addf(&buffer, "committer %s\n", git_committer_info(IDENT_ERROR_ON_NO_NAME));
        if (!encoding_is_utf8)
                strbuf_addf(&buffer, "encoding %s\n", git_commit_encoding);
        strbuf_addch(&buffer, '\n');
 
        /* And add the comment */
-       if (strbuf_read(&buffer, 0) < 0)
+       if (strbuf_read(&buffer, 0, 0) < 0)
                die("git-commit-tree: read returned %s", strerror(errno));
 
        /* And check the encoding */