for-each-reflog: not having $GIT_DIR/logs directory is not an error.
[gitweb.git] / tree.c
diff --git a/tree.c b/tree.c
index ef456be9dd0faee46435a3c3b126a36c2be58051..b6f02fecc46ec4633dc1ee75f38bc90761a4fbe3 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -4,7 +4,6 @@
 #include "commit.h"
 #include "tag.h"
 #include "tree-walk.h"
-#include <stdlib.h>
 
 const char *tree_type = "tree";
 
@@ -25,7 +24,7 @@ static int read_one_entry(const unsigned char *sha1, const char *base, int basel
        ce->ce_flags = create_ce_flags(baselen + len, stage);
        memcpy(ce->name, base, baselen);
        memcpy(ce->name + baselen, pathname, len+1);
-       memcpy(ce->sha1, sha1, 20);
+       hashcpy(ce->sha1, sha1);
        return add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
 }