git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] archive: error instead of triggering a segfault in `git archive --remote=""`

From
EGemilylime via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 9, 2025, 10:12 UTC
Message-ID
<pull.1877.git.1741515155475.gitgitgadget@gmail.com>
From: emilylime <emilyyyylime+git@gmail.com>
Signed-off-by: emilylime <emilyyyylime+git@gmail.com>
---
    Error instead of triggering a segfault in git archive --remote=""
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1877%2Femilyyyylime%2Ffix-archive-remote-segfault-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1877/emilyyyylime/fix-archive-remote-segfault-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1877
 builtin/archive.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/builtin/archive.c b/builtin/archive.c
index 13ea7308c8b..b6fdbfc7dca 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -97,6 +97,10 @@ int cmd_archive(int argc,
 	argc = parse_options(argc, argv, prefix, local_opts, NULL,
 			     PARSE_OPT_KEEP_ALL);
 
+	if (remote && !remote[0]) {
+		usage(N_("Option 'remote' may not be left empty"));
+	}
+
 	init_archivers();
 
 	if (output)

base-commit: f93ff170b93a1782659637824b25923245ac9dd1
-- 
gitgitgadget
Next: Patrick Steinhardt
Message 1 of 4 in “archive: error instead of triggering a segfault in `git archive --remote=""`”
  1. archive: error instead of triggering a segfault in `git archive --remote=""`emilylime via GitGitGadget, Mar 9, 2025
  2. Patrick SteinhardtMar 10, 2025
  3. Junio C HamanoMar 10, 2025
  4. Junio C HamanoMar 10, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.