summaryrefslogtreecommitdiff
path: root/src/indexer.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-04-05 18:26:52 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-11-27 11:09:20 +0000
commit7cd0bf65671a1a486242403aaa0237ed5dec9d2b (patch)
treeb75ce165cf71ed6d7e15275d30ddd3deb4af7c2b /src/indexer.c
parent87d378961cc05daeefefdb1023a738249b8c6cf6 (diff)
downloadlibgit2-7cd0bf65671a1a486242403aaa0237ed5dec9d2b.tar.gz
pack: use GIT_ASSERT
Diffstat (limited to 'src/indexer.c')
-rw-r--r--src/indexer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/indexer.c b/src/indexer.c
index b6a2ee45e..7b3db3101 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -900,8 +900,8 @@ static int inject_object(git_indexer *idx, git_oid *id)
entry->crc = crc32(0L, Z_NULL, 0);
/* Write out the object header */
- hdr_len = git_packfile__object_header(hdr, len, git_odb_object_type(obj));
- if ((error = append_to_pack(idx, hdr, hdr_len)) < 0)
+ if ((error = git_packfile__object_header(&hdr_len, hdr, len, git_odb_object_type(obj))) < 0 ||
+ (error = append_to_pack(idx, hdr, hdr_len)) < 0)
goto cleanup;
idx->pack->mwf.size += hdr_len;