summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/commit.c b/src/commit.c
index 05b70a983..4a340058a 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -159,6 +159,9 @@ static int git_commit__create_internal(
if (git_repository_odb__weakptr(&odb, repo) < 0)
goto cleanup;
+ if (git_odb__freshen(odb, tree) < 0)
+ goto cleanup;
+
if (git_odb_write(id, odb, buf.ptr, buf.size, GIT_OBJ_COMMIT) < 0)
goto cleanup;