summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2017-03-03 13:26:29 +0000
committerEdward Thomson <ethomson@github.com>2017-03-03 14:12:00 +0000
commit52d03f37f70ebde3e0a7794a60dbf68d0e69b9e8 (patch)
treeba8f647aca21274e92de8d3fecfa85199aa8cde3 /src/commit.c
parent3348570a0c544747f3a916010ee6064a91f98996 (diff)
downloadlibgit2-ethomson/freshen_trees.tar.gz
git_commit_create: freshen tree objects in commitethomson/freshen_trees
Freshen the tree object that a commit points to during commit time.
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;