aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2025-10-15 18:28:23 -0400
committerJunio C Hamano <gitster@pobox.com>2025-10-16 10:08:54 -0700
commit184f0abeb802f44c0e23abe3c8a3fc7448c78b99 (patch)
treeaa68856960be248306f0670debb14c219a4fc196
parentc0427692cb0fe03eb32fffc5bd06fad4ee434561 (diff)
downloadgit-184f0abeb802f44c0e23abe3c8a3fc7448c78b99.tar.gz
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>
-rw-r--r--builtin/repack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index bf413a6ee2..bed902adde 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -150,7 +150,8 @@ struct generated_pack {
struct tempfile *tempfiles[ARRAY_SIZE(exts)];
};
-static struct generated_pack *generated_pack_populate(const char *name)
+static struct generated_pack *generated_pack_populate(const char *name,
+ const char *packtmp)
{
struct stat statbuf;
struct strbuf path = STRBUF_INIT;
@@ -271,7 +272,7 @@ static void repack_promisor_objects(struct repository *repo,
line.buf);
write_promisor_file(promisor_name, NULL, 0);
- item->util = generated_pack_populate(item->string);
+ item->util = generated_pack_populate(item->string, packtmp);
free(promisor_name);
}
@@ -896,7 +897,7 @@ static int finish_pack_objects_cmd(const struct git_hash_algo *algop,
*/
if (local) {
item = string_list_append(names, line.buf);
- item->util = generated_pack_populate(line.buf);
+ item->util = generated_pack_populate(line.buf, packtmp);
}
}
fclose(out);