commit - 7cacbda68302e35afc316f115b101992f4069493
commit + 7eb23a1c9f6f12484a3e7f55551398d25fcbfd01
blob - cd456692c1f984bf69eba8d3a5fd3e93851a19c6
blob + 3c4b293336a4354fd8dd376c01e39b7f04a85458
--- lib/pack_create.c
+++ lib/pack_create.c
goto done;
m = meta[i];
m->off = ftello(packfile);
- err = got_object_raw_open(&raw, &outfd, repo, &m->id);
- if (err)
- goto done;
if (m->delta_len == 0) {
+ err = got_object_raw_open(&raw, &outfd, repo, &m->id);
+ if (err)
+ goto done;
err = packhdr(&nh, buf, sizeof(buf),
m->obj_type, raw->size);
if (err)
if (err)
goto done;
packfile_size += outlen;
+ got_object_raw_close(raw);
+ raw = NULL;
} else {
off_t remain;
if (delta_file == NULL) {
goto done;
packfile_size += outlen;
}
- got_object_raw_close(raw);
- raw = NULL;
}
SHA1Final(pack_sha1, &ctx);
n = fwrite(pack_sha1, 1, SHA1_DIGEST_LENGTH, packfile);