summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc9957b)
raw | patch | inline | side by side (parent: fc9957b)
author | Peter Eriksen <s022018@student.dtu.dk> | |
Sun, 2 Apr 2006 12:44:09 +0000 (14:44 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 4 Apr 2006 07:11:19 +0000 (00:11 -0700) |
This replaces occurences of "blob", "commit", "tag", and "tree",
where they're really used as type specifiers, which we already
have defined global constants for.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
where they're really used as type specifiers, which we already
have defined global constants for.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
23 files changed:
apply.c | patch | blob | history | |
blame.c | patch | blob | history | |
cat-file.c | patch | blob | history | |
combine-diff.c | patch | blob | history | |
commit-tree.c | patch | blob | history | |
convert-objects.c | patch | blob | history | |
diff-tree.c | patch | blob | history | |
entry.c | patch | blob | history | |
hash-object.c | patch | blob | history | |
index-pack.c | patch | blob | history | |
ls-tree.c | patch | blob | history | |
mktag.c | patch | blob | history | |
mktree.c | patch | blob | history | |
object.c | patch | blob | history | |
pack-objects.c | patch | blob | history | |
revision.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
tar-tree.c | patch | blob | history | |
tree-diff.c | patch | blob | history | |
tree-walk.c | patch | blob | history | |
unpack-file.c | patch | blob | history | |
unpack-objects.c | patch | blob | history | |
write-tree.c | patch | blob | history |
index c50b3a60464ea05307af8e8d1be576cf96415ff0..cc3f12e5557d1b6c333c890d6d0209aee74742e5 100644 (file)
--- a/apply.c
+++ b/apply.c
#include <fnmatch.h>
#include "cache.h"
#include "quote.h"
+#include "blob.h"
// --check turns on checking that the working tree matches the
// files that are being modified, but doesn't apply the patch
* applies to.
*/
write_sha1_file_prepare(desc->buffer, desc->size,
- "blob", sha1, hdr, &hdrlen);
+ blob_type, sha1, hdr, &hdrlen);
if (strcmp(sha1_to_hex(sha1), patch->old_sha1_prefix))
return error("the patch applies to '%s' (%s), "
"which does not match the "
@@ -1659,7 +1660,7 @@ static void add_index_file(const char *path, unsigned mode, void *buf, unsigned
if (lstat(path, &st) < 0)
die("unable to stat newly created file %s", path);
fill_stat_cache_info(ce, &st);
- if (write_sha1_file(buf, size, "blob", ce->sha1) < 0)
+ if (write_sha1_file(buf, size, blob_type, ce->sha1) < 0)
die("unable to create backing store for newly created file %s", path);
if (add_cache_entry(ce, ADD_CACHE_OK_TO_ADD) < 0)
die("unable to add cache entry for %s", path);
index 396defccc728db836732aa140e54620775509760..98f99922a78578a84468f1296d6e56b999829659 100644 (file)
--- a/blame.c
+++ b/blame.c
info->buf = read_sha1_file(info->sha1, type, &info->size);
- assert(!strcmp(type, "blob"));
+ assert(!strcmp(type, blob_type));
}
/* For debugging only */
diff --git a/cat-file.c b/cat-file.c
index 761111eb0f1f3266fe6bd0e9e561ee3d3d6c21d4..628f6cada89431acd23d612f7e0b10649348e088 100644 (file)
--- a/cat-file.c
+++ b/cat-file.c
*/
#include "cache.h"
#include "exec_cmd.h"
+#include "tag.h"
+#include "tree.h"
static void flush_buffer(const char *buf, unsigned long size)
{
die("Not a valid object name %s", argv[2]);
/* custom pretty-print here */
- if (!strcmp(type, "tree"))
+ if (!strcmp(type, tree_type))
return execl_git_cmd("ls-tree", argv[2], NULL);
buf = read_sha1_file(sha1, type, &size);
if (!buf)
die("Cannot read object %s", argv[2]);
- if (!strcmp(type, "tag"))
+ if (!strcmp(type, tag_type))
return pprint_tag(sha1, buf, size);
/* otherwise just spit out the data */
diff --git a/combine-diff.c b/combine-diff.c
index f17aab33f1d241097a16e2cfd8a1ab3361e45902..7693884fdb7e43d0aecd77ad1c71531181d7ceee 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
#include "cache.h"
#include "commit.h"
+#include "blob.h"
#include "diff.h"
#include "diffcore.h"
#include "quote.h"
return xcalloc(1, 1);
}
blob = read_sha1_file(sha1, type, size);
- if (strcmp(type, "blob"))
+ if (strcmp(type, blob_type))
die("object '%s' is not a blob!", sha1_to_hex(sha1));
return blob;
}
diff --git a/commit-tree.c b/commit-tree.c
index 16c17871334601b0b3c211cbedd8e8291af261a3..2d8651894a20e752eb47e6da439ad3cee13c29c4 100644 (file)
--- a/commit-tree.c
+++ b/commit-tree.c
* Copyright (C) Linus Torvalds, 2005
*/
#include "cache.h"
+#include "commit.h"
+#include "tree.h"
#define BLOCKING (1ul << 14)
if (argc < 2 || get_sha1_hex(argv[1], tree_sha1) < 0)
usage(commit_tree_usage);
- check_valid(tree_sha1, "tree");
+ check_valid(tree_sha1, tree_type);
for (i = 2; i < argc; i += 2) {
char *a, *b;
a = argv[i]; b = argv[i+1];
if (!b || strcmp(a, "-p") || get_sha1(b, parent_sha1[parents]))
usage(commit_tree_usage);
- check_valid(parent_sha1[parents], "commit");
+ check_valid(parent_sha1[parents], commit_type);
if (new_parent(parents))
parents++;
}
while (fgets(comment, sizeof(comment), stdin) != NULL)
add_buffer(&buffer, &size, "%s", comment);
- if (!write_sha1_file(buffer, size, "commit", commit_sha1)) {
+ if (!write_sha1_file(buffer, size, commit_type, commit_sha1)) {
printf("%s\n", sha1_to_hex(commit_sha1));
return 0;
}
diff --git a/convert-objects.c b/convert-objects.c
index b49bce2681caec6cf6ea008aae6d9c58fff60639..57de37faa53df5fb84247e2fd7486a108039676e 100644 (file)
--- a/convert-objects.c
+++ b/convert-objects.c
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
#include <time.h>
#include "cache.h"
+#include "blob.h"
+#include "commit.h"
+#include "tree.h"
struct entry {
unsigned char old_sha1[20];
@@ -122,7 +125,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base
buffer += len;
}
- write_sha1_file(new, newlen, "tree", result_sha1);
+ write_sha1_file(new, newlen, tree_type, result_sha1);
free(new);
return used;
}
@@ -262,8 +265,8 @@ static void convert_date(void *buffer, unsigned long size, unsigned char *result
memcpy(new + newlen, buffer, size);
newlen += size;
- write_sha1_file(new, newlen, "commit", result_sha1);
- free(new);
+ write_sha1_file(new, newlen, commit_type, result_sha1);
+ free(new);
}
static void convert_commit(void *buffer, unsigned long size, unsigned char *result_sha1)
buffer = xmalloc(size);
memcpy(buffer, data, size);
-
- if (!strcmp(type, "blob")) {
- write_sha1_file(buffer, size, "blob", entry->new_sha1);
- } else if (!strcmp(type, "tree"))
+
+ if (!strcmp(type, blob_type)) {
+ write_sha1_file(buffer, size, blob_type, entry->new_sha1);
+ } else if (!strcmp(type, tree_type))
convert_tree(buffer, size, entry->new_sha1);
- else if (!strcmp(type, "commit"))
+ else if (!strcmp(type, commit_type))
convert_commit(buffer, size, entry->new_sha1);
else
die("unknown object type '%s' in %s", type, sha1_to_hex(sha1));
diff --git a/diff-tree.c b/diff-tree.c
index f55a35a9d5f9ae4e3f7d3fd778a953cc9cc533ad..d1265d796388dd1c1a56c00f793893ee9dc6ed10 100644 (file)
--- a/diff-tree.c
+++ b/diff-tree.c
void *tree;
struct tree_desc empty, real;
- tree = read_object_with_reference(new, "tree", &real.size, NULL);
+ tree = read_object_with_reference(new, tree_type, &real.size, NULL);
if (!tree)
die("unable to read root tree (%s)", sha1_to_hex(new));
real.buf = tree;
index 5d9aefd03fa4ff0e86d1212dc3354c9b50bba22a..793724fd52063157545f523f6d88953b96385c2c 100644 (file)
--- a/entry.c
+++ b/entry.c
#include <sys/types.h>
#include <dirent.h>
#include "cache.h"
+#include "blob.h"
static void create_directories(const char *path, struct checkout *state)
{
char type[20];
new = read_sha1_file(ce->sha1, type, &size);
- if (!new || strcmp(type, "blob")) {
+ if (!new || strcmp(type, blob_type)) {
if (new)
free(new);
return error("git-checkout-index: unable to read sha1 file of %s (%s)",
diff --git a/hash-object.c b/hash-object.c
index 6502b5b3d1307a4cd7e8761c96aa7ecd5e70559f..43bd93bffb3f5e0b7b19a62865347a421d6a56a3 100644 (file)
--- a/hash-object.c
+++ b/hash-object.c
* GIT - The information manager from hell
*
* Copyright (C) Linus Torvalds, 2005
- * Copyright (C) Junio C Hamano, 2005
+ * Copyright (C) Junio C Hamano, 2005
*/
#include "cache.h"
+#include "blob.h"
static void hash_object(const char *path, const char *type, int write_object)
{
int main(int argc, char **argv)
{
int i;
- const char *type = "blob";
+ const char *type = blob_type;
int write_object = 0;
const char *prefix = NULL;
int prefix_length = -1;
diff --git a/index-pack.c b/index-pack.c
index babe34b2db520a311d6c8ef090383755ba1807c9..b39953dc698aae25f79caa9553e13bca6cd4e986 100644 (file)
--- a/index-pack.c
+++ b/index-pack.c
#include "delta.h"
#include "pack.h"
#include "csum-file.h"
+#include "blob.h"
+#include "commit.h"
+#include "tag.h"
+#include "tree.h"
static const char index_pack_usage[] =
"git-index-pack [-o index-file] pack-file";
const char *type_str;
switch (type) {
- case OBJ_COMMIT: type_str = "commit"; break;
- case OBJ_TREE: type_str = "tree"; break;
- case OBJ_BLOB: type_str = "blob"; break;
- case OBJ_TAG: type_str = "tag"; break;
+ case OBJ_COMMIT: type_str = commit_type; break;
+ case OBJ_TREE: type_str = tree_type; break;
+ case OBJ_BLOB: type_str = blob_type; break;
+ case OBJ_TAG: type_str = tag_type; break;
default:
die("bad type %d", type);
}
diff --git a/ls-tree.c b/ls-tree.c
index 26258c3cf99c9eec522ea1a13a2ded3beb93e171..e4ef200985030e8dee6f23dbe723bfa476160db0 100644 (file)
--- a/ls-tree.c
+++ b/ls-tree.c
const char *pathname, unsigned mode, int stage)
{
int retval = 0;
- const char *type = "blob";
+ const char *type = blob_type;
if (S_ISDIR(mode)) {
if (show_recursive(base, baselen, pathname)) {
if (!(ls_options & LS_SHOW_TREES))
return retval;
}
- type = "tree";
+ type = tree_type;
}
else if (ls_options & LS_TREE_ONLY)
return 0;
index fc6a9bf5f34158605add585439848367deaefac5..23288781cf6caad62253130f75112e18eb4905aa 100644 (file)
--- a/mktag.c
+++ b/mktag.c
#include "cache.h"
+#include "tag.h"
/*
* A signature file has a very simple fixed format: three lines
if (verify_tag(buffer, size) < 0)
die("invalid tag signature file");
- if (write_sha1_file(buffer, size, "tag", result_sha1) < 0)
+ if (write_sha1_file(buffer, size, tag_type, result_sha1) < 0)
die("unable to write tag file");
printf("%s\n", sha1_to_hex(result_sha1));
return 0;
diff --git a/mktree.c b/mktree.c
index f85358522b93d285a13193b44f68c1ebefc101b5..ab63cd99d4ae41310b97811cf738803afe16ff1f 100644 (file)
--- a/mktree.c
+++ b/mktree.c
#include "cache.h"
#include "strbuf.h"
#include "quote.h"
+#include "tree.h"
static struct treeent {
unsigned mode;
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]";
diff --git a/object.c b/object.c
index c9ca481498281adab056a364a3854180456f20f3..b5c0ecf2b72bd520ee88b790aa424588178d02d3 100644 (file)
--- a/object.c
+++ b/object.c
struct object *obj;
if (check_sha1_signature(sha1, buffer, size, type) < 0)
printf("sha1 mismatch %s\n", sha1_to_hex(sha1));
- if (!strcmp(type, "blob")) {
+ if (!strcmp(type, blob_type)) {
struct blob *blob = lookup_blob(sha1);
parse_blob_buffer(blob, buffer, size);
obj = &blob->object;
- } else if (!strcmp(type, "tree")) {
+ } else if (!strcmp(type, tree_type)) {
struct tree *tree = lookup_tree(sha1);
parse_tree_buffer(tree, buffer, size);
obj = &tree->object;
- } else if (!strcmp(type, "commit")) {
+ } else if (!strcmp(type, commit_type)) {
struct commit *commit = lookup_commit(sha1);
parse_commit_buffer(commit, buffer, size);
if (!commit->buffer) {
buffer = NULL;
}
obj = &commit->object;
- } else if (!strcmp(type, "tag")) {
+ } else if (!strcmp(type, tag_type)) {
struct tag *tag = lookup_tag(sha1);
parse_tag_buffer(tag, buffer, size);
obj = &tag->object;
diff --git a/pack-objects.c b/pack-objects.c
index ccfaa5f609431490c886abe0e0af842987428bf6..4145f2530501dd80c6ec8a26465bd45f2e258f17 100644 (file)
--- a/pack-objects.c
+++ b/pack-objects.c
#include "cache.h"
#include "object.h"
+#include "blob.h"
+#include "commit.h"
+#include "tag.h"
+#include "tree.h"
#include "delta.h"
#include "pack.h"
#include "csum-file.h"
if (!add_object_entry(sha1, hash, 1))
continue;
- if (!strcmp(type, "tree")) {
+ if (!strcmp(type, tree_type)) {
struct tree_desc sub;
void *elem;
struct name_path me;
struct tree_desc tree;
void *elem;
- elem = read_object_with_reference(sha1, "tree", &tree.size, NULL);
+ elem = read_object_with_reference(sha1, tree_type, &tree.size, NULL);
tree.buf = elem;
if (!tree.buf)
return;
die("unable to get type of object %s",
sha1_to_hex(entry->sha1));
- if (!strcmp(type, "commit")) {
+ if (!strcmp(type, commit_type)) {
entry->type = OBJ_COMMIT;
- } else if (!strcmp(type, "tree")) {
+ } else if (!strcmp(type, tree_type)) {
entry->type = OBJ_TREE;
- } else if (!strcmp(type, "blob")) {
+ } else if (!strcmp(type, blob_type)) {
entry->type = OBJ_BLOB;
- } else if (!strcmp(type, "tag")) {
+ } else if (!strcmp(type, tag_type)) {
entry->type = OBJ_TAG;
} else
die("unable to pack object %s of type %s",
diff --git a/revision.c b/revision.c
index 728b6d111dd3e11de6f5a6a0baa940d54d621e6a..ce35b5a7e6960383debb4541c573ecf02d192cae 100644 (file)
--- a/revision.c
+++ b/revision.c
if (!t1)
return 0;
- tree = read_object_with_reference(t1->object.sha1, "tree", &real.size, NULL);
+ tree = read_object_with_reference(t1->object.sha1, tree_type, &real.size, NULL);
if (!tree)
return 0;
real.buf = tree;
diff --git a/sha1_file.c b/sha1_file.c
index 58edec0bb677e480552b9464e905ea983747c183..ba8c4f76011c68548e959a17883b9a9d6cfbeeff 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
#include "cache.h"
#include "delta.h"
#include "pack.h"
+#include "blob.h"
+#include "commit.h"
+#include "tag.h"
+#include "tree.h"
#ifndef O_NOATIME
#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))
}
switch (kind) {
case OBJ_COMMIT:
- strcpy(type, "commit");
+ strcpy(type, commit_type);
break;
case OBJ_TREE:
- strcpy(type, "tree");
+ strcpy(type, tree_type);
break;
case OBJ_BLOB:
- strcpy(type, "blob");
+ strcpy(type, blob_type);
break;
case OBJ_TAG:
- strcpy(type, "tag");
+ strcpy(type, tag_type);
break;
default:
die("corrupted pack file %s containing object of kind %d",
unuse_packed_git(p);
return retval;
case OBJ_COMMIT:
- strcpy(type, "commit");
+ strcpy(type, commit_type);
break;
case OBJ_TREE:
- strcpy(type, "tree");
+ strcpy(type, tree_type);
break;
case OBJ_BLOB:
- strcpy(type, "blob");
+ strcpy(type, blob_type);
break;
case OBJ_TAG:
- strcpy(type, "tag");
+ strcpy(type, tag_type);
break;
default:
die("corrupted pack file %s containing object of kind %d",
retval = unpack_delta_entry(pack, size, left, type, sizep, p);
return retval;
case OBJ_COMMIT:
- strcpy(type, "commit");
+ strcpy(type, commit_type);
break;
case OBJ_TREE:
- strcpy(type, "tree");
+ strcpy(type, tree_type);
break;
case OBJ_BLOB:
- strcpy(type, "blob");
+ strcpy(type, blob_type);
break;
case OBJ_TAG:
- strcpy(type, "tag");
+ strcpy(type, tag_type);
break;
default:
return NULL;
return buffer;
}
/* Handle references */
- else if (!strcmp(type, "commit"))
+ else if (!strcmp(type, commit_type))
ref_type = "tree ";
- else if (!strcmp(type, "tag"))
+ else if (!strcmp(type, tag_type))
ref_type = "object ";
else {
free(buffer);
@@ -1625,7 +1629,7 @@ int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object)
return -1;
}
if (!type)
- type = "blob";
+ type = blob_type;
if (write_object)
ret = write_sha1_file(buf, off, type, sha1);
else {
@@ -1652,7 +1656,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, con
return -1;
if (!type)
- type = "blob";
+ type = blob_type;
if (write_object)
ret = write_sha1_file(buf, size, type, sha1);
else {
@@ -1690,9 +1694,9 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, int write
if (!write_object) {
unsigned char hdr[50];
int hdrlen;
- write_sha1_file_prepare(target, st->st_size, "blob",
+ write_sha1_file_prepare(target, st->st_size, blob_type,
sha1, hdr, &hdrlen);
- } else if (write_sha1_file(target, st->st_size, "blob", sha1))
+ } else if (write_sha1_file(target, st->st_size, blob_type, sha1))
return error("%s: failed to insert into database",
path);
free(target);
diff --git a/tar-tree.c b/tar-tree.c
index bd289a98f80d4a6869f3d7345bd53f16a43682bd..fc60a90873d1928ce3ada6d26f0a0ae571d43773 100644 (file)
--- a/tar-tree.c
+++ b/tar-tree.c
} else
archive_time = time(NULL);
- tree.buf = read_object_with_reference(sha1, "tree", &tree.size,
+ tree.buf = read_object_with_reference(sha1, tree_type, &tree.size,
tree_sha1);
if (!tree.buf)
die("not a reference to a tag, commit or tree object: %s",
diff --git a/tree-diff.c b/tree-diff.c
index 7bb6109111c0e8d4de11597fd64acb2a8b346879..701fbba65c2d718a2cdff170a6be6d9993ad27d7 100644 (file)
--- a/tree-diff.c
+++ b/tree-diff.c
*/
#include "cache.h"
#include "diff.h"
+#include "tree.h"
// What paths are we interested in?
static int nr_paths = 0;
@@ -148,7 +149,7 @@ static int show_entry(struct diff_options *opt, const char *prefix, struct tree_
void *tree;
tree = read_sha1_file(sha1, type, &inner.size);
- if (!tree || strcmp(type, "tree"))
+ if (!tree || strcmp(type, tree_type))
die("corrupt tree sha %s", sha1_to_hex(sha1));
inner.buf = tree;
@@ -206,10 +207,10 @@ int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const cha
struct tree_desc t1, t2;
int retval;
- tree1 = read_object_with_reference(old, "tree", &t1.size, NULL);
+ tree1 = read_object_with_reference(old, tree_type, &t1.size, NULL);
if (!tree1)
die("unable to read source tree (%s)", sha1_to_hex(old));
- tree2 = read_object_with_reference(new, "tree", &t2.size, NULL);
+ tree2 = read_object_with_reference(new, tree_type, &t2.size, NULL);
if (!tree2)
die("unable to read destination tree (%s)", sha1_to_hex(new));
t1.buf = tree1;
diff --git a/tree-walk.c b/tree-walk.c
index 0735f4046dd8524e92e97a8ce6cc5c0991208b01..bf8bfdfdf8564d10b0ca5450dc62612e0ae4525d 100644 (file)
--- a/tree-walk.c
+++ b/tree-walk.c
#include "cache.h"
#include "tree-walk.h"
+#include "tree.h"
void *fill_tree_descriptor(struct tree_desc *desc, const unsigned char *sha1)
{
void *buf = NULL;
if (sha1) {
- buf = read_object_with_reference(sha1, "tree", &size, NULL);
+ buf = read_object_with_reference(sha1, tree_type, &size, NULL);
if (!buf)
die("unable to read tree %s", sha1_to_hex(sha1));
}
diff --git a/unpack-file.c b/unpack-file.c
index 3accb974dd448233a01e82ab1d6e3599d825fa9e..23a85623019c3b7a465fba86132df3f4b75d94a5 100644 (file)
--- a/unpack-file.c
+++ b/unpack-file.c
#include "cache.h"
+#include "blob.h"
static char *create_temp_file(unsigned char *sha1)
{
int fd;
buf = read_sha1_file(sha1, type, &size);
- if (!buf || strcmp(type, "blob"))
+ if (!buf || strcmp(type, blob_type))
die("unable to read blob object %s", sha1_to_hex(sha1));
strcpy(path, ".merge_file_XXXXXX");
diff --git a/unpack-objects.c b/unpack-objects.c
index 815a1b382b1f92686efd00bee5794a8480d7f7b7..3b824b04a262b92808ba138b1922badbbb25da89 100644 (file)
--- a/unpack-objects.c
+++ b/unpack-objects.c
#include "object.h"
#include "delta.h"
#include "pack.h"
+#include "blob.h"
+#include "commit.h"
+#include "tag.h"
+#include "tree.h"
#include <sys/time.h>
const char *type;
switch (kind) {
- case OBJ_COMMIT: type = "commit"; break;
- case OBJ_TREE: type = "tree"; break;
- case OBJ_BLOB: type = "blob"; break;
- case OBJ_TAG: type = "tag"; break;
+ case OBJ_COMMIT: type = commit_type; break;
+ case OBJ_TREE: type = tree_type; break;
+ case OBJ_BLOB: type = blob_type; break;
+ case OBJ_TAG: type = tag_type; break;
default: die("bad type %d", kind);
}
if (!dry_run)
diff --git a/write-tree.c b/write-tree.c
index addb5de3b6ea5a84ea71293aee5b50f1e70ea720..dcad6e66708f7cf9cae682da6a9a22086381ecec 100644 (file)
--- a/write-tree.c
+++ b/write-tree.c
* Copyright (C) Linus Torvalds, 2005
*/
#include "cache.h"
+#include "tree.h"
static int missing_ok = 0;
nr++;
}
- write_sha1_file(buffer, offset, "tree", returnsha1);
+ write_sha1_file(buffer, offset, tree_type, returnsha1);
free(buffer);
return nr;
}