diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/pack-objects.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 6643c1657a..3258fa96e8 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -584,16 +584,10 @@ static void write_pack_file(void) unsigned char sha1[20]; char *pack_tmp_name = NULL; - if (pack_to_stdout) { + if (pack_to_stdout) f = sha1fd_throughput(1, "<stdout>", progress_state); - } else { - char tmpname[PATH_MAX]; - int fd; - fd = odb_mkstemp(tmpname, sizeof(tmpname), - "pack/tmp_pack_XXXXXX"); - pack_tmp_name = xstrdup(tmpname); - f = sha1fd(fd, pack_tmp_name); - } + else + f = create_tmp_packfile(&pack_tmp_name); offset = write_pack_header(f, nr_remaining); if (!offset) |