]> asedeno.scripts.mit.edu Git - git.git/blobdiff - mktree.c
Now that cache.h needs strbuf.h, remove useless includes.
[git.git] / mktree.c
index 2e84889c02dd110caff0e896a6899f877ca863f1..5dab4bd367c3d62b288b34abb23c083326fc41b9 100644 (file)
--- a/mktree.c
+++ b/mktree.c
@@ -4,7 +4,6 @@
  * Copyright (c) Junio C Hamano, 2006
  */
 #include "cache.h"
-#include "strbuf.h"
 #include "quote.h"
 #include "tree.h"
 
@@ -51,9 +50,8 @@ static void write_tree(unsigned char *sha1)
        qsort(entries, used, sizeof(*entries), ent_compare);
        for (size = i = 0; i < used; i++)
                size += 32 + entries[i]->len;
-       strbuf_init(&buf);
-       strbuf_grow(&buf, size);
 
+       strbuf_init(&buf, size);
        for (i = 0; i < used; i++) {
                struct treeent *ent = entries[i];
                strbuf_addf(&buf, "%o %s%c", ent->mode, ent->name, '\0');
@@ -83,7 +81,7 @@ int main(int ac, char **av)
                av++;
        }
 
-       strbuf_init(&sb);
+       strbuf_init(&sb, 0);
        while (1) {
                char *ptr, *ntr;
                unsigned mode;