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-22 17:36:30 -0500
commit21603b8bf93c548bacb5434962fac00db6850004 (patch)
tree359dd8a3039d72529074e6aa2ed7ab6d5adad4eb
parent823fd656f574a8904744489bf93c6f27042a628d (diff)
downloadlibgit2-21603b8bf93c548bacb5434962fac00db6850004.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]);