Merge pull request #2535 from libgit2/cmn/unpack-offset pack: return the correct final offset
diff --git a/src/pack.c b/src/pack.c
index 22dbd56..b05aa91 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -744,7 +744,7 @@ cleanup:
git__free(obj->data);
if (elem)
- *obj_offset = elem->offset;
+ *obj_offset = curpos;
git_array_clear(chain);
return error;