git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] transport: Catch non positive --depth option value
@ 2013-11-13 16:06 "Andrés G. Aragoneses"
  2013-11-16  2:58 ` Duy Nguyen
  2013-11-18 16:51 ` Junio C Hamano
  0 siblings, 2 replies; 16+ messages in thread
From: "Andrés G. Aragoneses" @ 2013-11-13 16:06 UTC (permalink / raw)
  To: git

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 mean 'no depth' or
'no history' but 'full depth' instead).

Signed-off-by: Andres G. Aragoneses <knocte@gmail.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' (non positive)", value);
  		}
  		return 0;
  	}
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-11-26 22:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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       ` [PATCHv3] " "Andrés G. Aragoneses"
2013-11-21 17:34         ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).