summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-22 06:42:50 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-01-23 09:48:21 -0500
commit751e9a04fe02662338f66ec9f54b47f77cdf0cdb (patch)
treed63c2fbc1359aadbae0d7f09e10223b5d64ae5d1
parent5a45616c16fcff7051416c64703988c787015259 (diff)
downloadlibgit2-751e9a04fe02662338f66ec9f54b47f77cdf0cdb.tar.gz
treecache: write the raw id not the object
We explicitly want to write on the id data, not the beginning of the object data, which may contain other information in the future.
-rw-r--r--src/tree-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tree-cache.c b/src/tree-cache.c
index 0977c92f3..cd69e7bf8 100644
--- a/src/tree-cache.c
+++ b/src/tree-cache.c
@@ -263,7 +263,7 @@ static void write_tree(git_str *out, git_tree_cache *tree)
git_str_printf(out, "%s%c%"PRIdZ" %"PRIuZ"\n", tree->name, 0, tree->entry_count, tree->children_count);
if (tree->entry_count != -1)
- git_str_put(out, (const char *) &tree->oid, GIT_OID_RAWSZ);
+ git_str_put(out, (char *)&tree->oid.id, GIT_OID_RAWSZ);
for (i = 0; i < tree->children_count; i++)
write_tree(out, tree->children[i]);