All of lore.kernel.org
 help / color / mirror / Atom feed
From: "emilylime via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: emilylime <emilyyyylime+git@gmail.com>,
	emilylime <emilyyyylime+git@gmail.com>
Subject: [PATCH] archive: error instead of triggering a segfault in `git archive --remote=""`
Date: Sun, 09 Mar 2025 10:12:35 +0000	[thread overview]
Message-ID: <pull.1877.git.1741515155475.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2025-03-09 10:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-09 10:12 emilylime via GitGitGadget [this message]
2025-03-10  7:37 ` [PATCH] archive: error instead of triggering a segfault in `git archive --remote=""` Patrick Steinhardt
2025-03-10 15:59   ` Junio C Hamano
2025-03-10 11:25 ` Junio C Hamano

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=pull.1877.git.1741515155475.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=emilyyyylime+git@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.