Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Move "read_tree()" to "tree.c" to be used as a generic helper function.
[gitweb.git]
/
write-tree.c
diff --git
a/write-tree.c
b/write-tree.c
index b58871c7d9e7b3a3772831f2f9df04268e908987..827809dbddbff6dd8cf842641f6db5ad2f3ae07a 100644
(file)
--- a/
write-tree.c
+++ b/
write-tree.c
@@
-93,10
+93,8
@@
static int write_tree(struct cache_entry **cachep, int maxentries, const char *b
i -= 5;
memcpy(buffer+i, "tree ", 5);
- buffer += i;
- offset -= i;
-
- write_sha1_file(buffer, offset, returnsha1);
+ write_sha1_file(buffer + i, offset - i, returnsha1);
+ free(buffer);
return nr;
}