diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 43b50ecfb7..cf233ef6ed 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -155,7 +155,7 @@ sub rebuild {
 		# if we merged or otherwise started elsewhere, this is
 		# how we break out of it
 		next if (defined $SVN_UUID && ($uuid ne $SVN_UUID));
-		next if (defined $SVN_URL && ($url ne $SVN_URL));
+		next if (defined $SVN_URL && defined $url && ($url ne $SVN_URL));
 
 		print "r$rev = $c\n";
 		unless (defined $latest) {