From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michele Ballabio Subject: [PATCH 2/2] builtin-prune.c: fix object parsing and use parse_options() Date: Sun, 23 Mar 2008 21:50:29 +0100 Message-ID: <200803232150.29971.barra_cuda@katamail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Junio C Hamano To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Mar 23 22:24:57 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1JdXgV-0001No-AG for gcvg-git-2@gmane.org; Sun, 23 Mar 2008 22:24:55 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755357AbYCWVYO (ORCPT ); Sun, 23 Mar 2008 17:24:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755326AbYCWVYO (ORCPT ); Sun, 23 Mar 2008 17:24:14 -0400 Received: from smtp.katamail.com ([62.149.157.154]:41706 "HELO smtp1.pc.aruba.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1755312AbYCWVYN (ORCPT ); Sun, 23 Mar 2008 17:24:13 -0400 Received: (qmail 28868 invoked by uid 89); 23 Mar 2008 21:20:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on smtp1-pc X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=RDNS_NONE autolearn=disabled version=3.2.3 Received: from unknown (HELO host124-56-static.104-80-b.business.telecomitalia.it) (barra?cuda@katamail.com@80.104.56.124) by smtp1-pc with SMTP; 23 Mar 2008 21:20:40 -0000 User-Agent: KMail/1.9.7 Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: git-prune used to remove loose objects whether they were specified in the command line or not. This patch makes git-prune behave as stated in the manpage: it does not prune any listed head nor reachable objects; the parsing machinery now uses parse_options(). Signed-off-by: Michele Ballabio --- builtin-prune.c | 50 ++++++++++++++++++++++++++++++-------------------- t/t5304-prune.sh | 2 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/builtin-prune.c b/builtin-prune.c index bb8ead9..7b3e15d 100644 --- a/builtin-prune.c +++ b/builtin-prune.c @@ -4,8 +4,12 @@ #include "revision.h" #include "builtin.h" #include "reachable.h" +#include "parse-options.h" -static const char prune_usage[] = "git-prune [-n]"; +static const char * const prune_usage[] = { + "git-prune [-n] [--expire