Remove unnecessary forward declaration of unpack_entry.
[gitweb.git] / mktree.c
index f85358522b93d285a13193b44f68c1ebefc101b5..93241385e4aee76fc42db5849365740c474b9bdd 100644 (file)
--- a/mktree.c
+++ b/mktree.c
@@ -6,6 +6,7 @@
 #include "cache.h"
 #include "strbuf.h"
 #include "quote.h"
+#include "tree.h"
 
 static struct treeent {
        unsigned mode;
@@ -48,7 +49,6 @@ static void write_tree(unsigned char *sha1)
        int i;
 
        qsort(entries, used, sizeof(*entries), ent_compare);
-       size = 100;
        for (size = i = 0; i < used; i++)
                size += 32 + entries[i]->len;
        buffer = xmalloc(size);
@@ -67,10 +67,10 @@ static void write_tree(unsigned char *sha1)
                memcpy(buffer + offset, ent->sha1, 20);
                offset += 20;
        }
-       write_sha1_file(buffer, offset, "tree", sha1);
+       write_sha1_file(buffer, offset, tree_type, sha1);
 }
 
-static const char mktree_usage[] = "mktree [-z]";
+static const char mktree_usage[] = "git-mktree [-z]";
 
 int main(int ac, char **av)
 {