git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-svn: clone: Fail on missing url argument

From
CLChristopher Layne <clayne@anodized.com>
Date
Jul 3, 2016, 05:39 UTC
Message-ID
<20160703053923.GA12956@ns1.signalpunk.com>
* cmd_clone should detect a missing $url arg before using it otherwise
  an uninitialized value error is emitted in even the simplest case of
  'git svn clone' without arguments.
Signed-off-by: Christopher Layne <clayne@anodized.com>
---
 git-svn.perl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/git-svn.perl b/git-svn.perl
index 05eced0..f609e54 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -507,7 +507,10 @@ sub init_subdir {
 
 sub cmd_clone {
 	my ($url, $path) = @_;
-	if (!defined $path &&
+	if (!$url) {
+		die "SVN repository location required ",
+		    "as a command-line argument\n";
+	} elsif (!defined $path &&
 	    (defined $_trunk || @_branches || @_tags ||
 	     defined $_stdlayout) &&
 	    $url !~ m#^[a-z\+]+://#) {
-- 
2.7.3
Next: Eric Wong
Message 1 of 4 in “git-svn: clone: Fail on missing url argument”
  1. git-svn: clone: Fail on missing url argumentChristopher Layne, Jul 3, 2016
  2. Eric WongJul 3, 2016
  3. Christopher LayneJul 3, 2016
  4. Junio C HamanoJul 6, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.