From: "\"Andrés G. Aragoneses\"" <knocte@gmail.com>
To: git@vger.kernel.org
Cc: Duy Nguyen <pclouds@gmail.com>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCHv3] transport: Catch non positive --depth option value
Date: Thu, 21 Nov 2013 16:27:28 +0100 [thread overview]
Message-ID: <528E2660.6020107@gmail.com> (raw)
In-Reply-To: <xmqq61ro9utf.fsf@gitster.dls.corp.google.com>
>From 99e387151594572dc136bf1fae45593ee710e817 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= <knocte@gmail.com>
Date: Wed, 13 Nov 2013 16:55:08 +0100
Subject: [PATCH] transport: Catch non positive --depth option value
Instead of simply ignoring the value passed to --depth
option when it is zero or negative, now it is caught
and reported.
This will let people know that they were using the
option incorrectly (as depth<0 should be simply invalid,
and under the hood depth==0 didn't have any effect).
Signed-off-by: Andres G. Aragoneses <knocte@gmail.com>
Reviewed-by: Duy Nguyen <pclouds@gmail.com>
Reviewed-by: Junio C Hamano <gitster@pobox.com>
---
transport.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/transport.c b/transport.c
index 7202b77..edd63eb 100644
--- a/transport.c
+++ b/transport.c
@@ -483,6 +483,8 @@ static int set_git_option(struct git_transport_options *opts,
opts->depth = strtol(value, &end, 0);
if (*end)
die("transport: invalid depth option '%s'", value);
+ if (opts->depth < 1)
+ die("transport: invalid depth option '%s' (must be positive)", value);
}
return 0;
}
--
1.8.1.2
next prev parent reply other threads:[~2013-11-21 15:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 16:06 [PATCH] transport: Catch non positive --depth option value "Andrés G. Aragoneses"
2013-11-16 2:58 ` Duy Nguyen
2013-11-18 16:51 ` Junio C Hamano
2013-11-18 22:45 ` [PATCHv2] " "Andrés G. Aragoneses"
2013-11-19 17:15 ` Junio C Hamano
2013-11-21 15:27 ` "Andrés G. Aragoneses" [this message]
2013-11-21 17:34 ` [PATCHv3] " Junio C Hamano
2013-11-21 20:18 ` Junio C Hamano
2013-11-22 1:18 ` Duy Nguyen
2013-11-25 23:34 ` "Andrés G. Aragoneses"
2013-11-26 3:06 ` Duy Nguyen
2013-11-26 10:43 ` "Andrés G. Aragoneses"
2013-11-26 11:09 ` Duy Nguyen
2013-11-26 11:41 ` [PATCHv4] " "Andrés G. Aragoneses"
2013-11-26 19:09 ` Jonathan Nieder
2013-11-26 22: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=528E2660.6020107@gmail.com \
--to=knocte@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.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.