diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 67eefa2932717bfd4a5daa8ad3a4379af1ef78db..cedef52fd3d62a3dd2e439a46579362b22c69642 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
snprintf(tmpname, sizeof(tmpname), "%s-%s.pack",
base_name, sha1_to_hex(sha1));
+ free_pack_by_name(tmpname);
if (adjust_perm(pack_tmp_name, mode))
die("unable to make temporary pack file readable: %s",
strerror(errno));