All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH 2/2] read-tree: at least one tree-ish argument is required
Date: Tue, 15 Dec 2009 09:43:38 +0100	[thread overview]
Message-ID: <4B274C3A.4060808@viscovery.net> (raw)
In-Reply-To: <4B274BDE.8000504@viscovery.net>

From: Johannes Sixt <j6t@kdbg.org>

Previously, it was possible to run read-tree without any arguments,
whereupon it purged the index!

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 Discovered by typing

   git ..daab02

 with help.autocorrect > 0 :-)

 -- Hannes

 builtin-read-tree.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 50413ca..31623b9 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -125,6 +125,9 @@ int cmd_read_tree(int argc, const char **argv,
 		stage = opts.merge = 1;
 	}

+	if (argc == 0)
+		usage_with_options(read_tree_usage, read_tree_options);
+
 	for (i = 0; i < argc; i++) {
 		const char *arg = argv[i];

-- 
1.6.6.rc1.46.g1635

  reply	other threads:[~2009-12-15  8:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15  8:42 [PATCH 1/2] filter-branch: remove an unnecessary use of 'git read-tree' Johannes Sixt
2009-12-15  8:43 ` Johannes Sixt [this message]
2009-12-18  9:51   ` [PATCH 2/2] read-tree: at least one tree-ish argument is required Johannes Sixt
2009-12-18 18:11     ` Junio C Hamano
2009-12-18 19:04       ` Johannes Sixt
2009-12-18 19:24         ` Sverre Rabbelier
2009-12-18 19:32         ` Junio C Hamano
2009-12-18 19:37           ` Sverre Rabbelier
2009-12-18 19:49             ` Junio C Hamano
2009-12-18 19:59               ` Sverre Rabbelier
2009-12-18 20:13                 ` Junio C Hamano
2009-12-18 20:21                   ` Sverre Rabbelier
2009-12-18 22:04               ` Johannes Sixt
2009-12-18 22:17                 ` Jakub Narebski
2009-12-18 23:46                   ` Junio C Hamano
2009-12-19  3:25                     ` Nanako Shiraishi
2009-12-19  4:43                       ` Junio C Hamano
2009-12-19  4:53                         ` Junio C Hamano
2009-12-19 10:56                           ` Johannes Schindelin
2009-12-15 17:19 ` [PATCH 1/2] filter-branch: remove an unnecessary use of 'git read-tree' Johannes Schindelin
2009-12-16  0:19 ` 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=4B274C3A.4060808@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.