From: "René Scharfe" <l.s.r@web.de>
To: Git List <git@vger.kernel.org>
Subject: [PATCH] archive: pass export-subst attribute value as parameter
Date: Sat, 28 Nov 2026 19:47:49 +0100 [thread overview]
Message-ID: <6c09fc91-b461-451d-90d6-512a4f785d8a@web.de> (raw)
The member "convert" of struct archiver_args is used to pass the value
of blob attribute export-subst to object_file_to_archive(). That's an
unusual place and a misleading name. Add and use an appropriately named
parameter to that function instead.
Signed-off-by: René Scharfe <l.s.r@web.de>
---
archive.c | 12 +++++++-----
archive.h | 1 -
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/archive.c b/archive.c
index 59790be986..0aa610b5c5 100644
--- a/archive.c
+++ b/archive.c
@@ -86,11 +86,12 @@ static void *object_file_to_archive(const struct archiver_args *args,
const char *path,
const struct object_id *oid,
unsigned int mode,
+ bool export_subst,
enum object_type *type,
size_t *sizep)
{
void *buffer;
- const struct commit *commit = args->convert ? args->commit : NULL;
+ const struct commit *commit = export_subst ? args->commit : NULL;
struct checkout_metadata meta;
init_checkout_metadata(&meta, args->refname,
@@ -161,8 +162,8 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
size_t size;
void *buffer;
enum object_type type;
+ bool export_subst = 0;
- args->convert = 0;
strbuf_reset(&path);
strbuf_grow(&path, PATH_MAX);
strbuf_add(&path, args->base, args->baselen);
@@ -177,7 +178,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
check = get_archive_attrs(args->repo->index, path_without_prefix);
if (check_attr_export_ignore(check))
return 0;
- args->convert = check_attr_export_subst(check);
+ export_subst = check_attr_export_subst(check);
}
if (args->prefix) {
@@ -214,12 +215,13 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
}
/* Stream it? */
- if (S_ISREG(mode) && !args->convert &&
+ if (S_ISREG(mode) && !export_subst &&
odb_read_object_info(args->repo->objects, oid, &size) == OBJ_BLOB &&
size > repo_settings_get_big_file_threshold(the_repository))
return write_entry(args, oid, path.buf, path.len, mode, NULL, size);
- buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size);
+ buffer = object_file_to_archive(args, path.buf, oid, mode, export_subst,
+ &type, &size);
if (!buffer)
return error(_("cannot read '%s'"), oid_to_hex(oid));
err = write_entry(args, oid, path.buf, path.len, mode, buffer, size);
diff --git a/archive.h b/archive.h
index bbe65ba0f9..e5ed3283c5 100644
--- a/archive.h
+++ b/archive.h
@@ -21,7 +21,6 @@ struct archiver_args {
struct pathspec pathspec;
unsigned int verbose : 1;
unsigned int worktree_attributes : 1;
- unsigned int convert : 1;
int compression_level;
struct string_list extra_files;
struct pretty_print_context *pretty_ctx;
--
2.56.1
next reply other threads:[~2026-11-28 18:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 18:47 René Scharfe [this message]
2026-11-28 22:38 ` [PATCH] archive: pass export-subst attribute value as parameter Junio C Hamano
2026-11-30 15:55 ` René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6c09fc91-b461-451d-90d6-512a4f785d8a@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox