Skip to content

Commit 184f0ab

Browse files
ttaylorrgitster
authored andcommitted
builtin/repack.c: pass "packtmp" to generated_pack_populate()
In a similar spirit as previous commits, this function needs to know the temporary pack prefix, which it currently accesses through the static "packtmp" variable within builtin/repack.c. Pass it explicitly as a function parameter to facilitate moving this function out of builtin/repack.c entirely. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c042769 commit 184f0ab

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

builtin/repack.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ struct generated_pack {
150150
struct tempfile *tempfiles[ARRAY_SIZE(exts)];
151151
};
152152

153-
static struct generated_pack *generated_pack_populate(const char *name)
153+
static struct generated_pack *generated_pack_populate(const char *name,
154+
const char *packtmp)
154155
{
155156
struct stat statbuf;
156157
struct strbuf path = STRBUF_INIT;
@@ -271,7 +272,7 @@ static void repack_promisor_objects(struct repository *repo,
271272
line.buf);
272273
write_promisor_file(promisor_name, NULL, 0);
273274

274-
item->util = generated_pack_populate(item->string);
275+
item->util = generated_pack_populate(item->string, packtmp);
275276

276277
free(promisor_name);
277278
}
@@ -896,7 +897,7 @@ static int finish_pack_objects_cmd(const struct git_hash_algo *algop,
896897
*/
897898
if (local) {
898899
item = string_list_append(names, line.buf);
899-
item->util = generated_pack_populate(line.buf);
900+
item->util = generated_pack_populate(line.buf, packtmp);
900901
}
901902
}
902903
fclose(out);

0 commit comments

Comments
 (0)