Thread (16 messages) flat view 16 messages, 2 authors, 2018-10-25
STALE2839d

[PATCH 1/1] archive: init archivers before determining format

From: <hidden>
Date: 2018-10-19 23:19:36
Subsystem: the rest · Maintainer: Linus Torvalds

When passing both --remote and --output to git-archive, initialize the
archivers before attempting to determine the format from the output
filename. Without initialization, the format cannot be determined.

Signed-off-by: Josh Steadmon <redacted>
---
 builtin/archive.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/builtin/archive.c b/builtin/archive.c
index e74f675390..dd3283a247 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -45,7 +45,10 @@ static int run_remote_archiver(int argc, const char **argv,
 	 * it.
 	 */
 	if (name_hint) {
-		const char *format = archive_format_from_filename(name_hint);
+		const char *format;
+		init_tar_archiver();
+		init_zip_archiver();
+		format = archive_format_from_filename(name_hint);
 		if (format)
 			packet_write_fmt(fd[1], "argument --format=%s\n", format);
 	}
-- 
2.19.1.568.g152ad8e336-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help