path: root/perl/Git
diff options
authorChristian Couder <>2016-05-07 06:58:43 (GMT)
committerEric Wong <>2016-05-08 00:50:19 (GMT)
commit523a33ca17c76bee007d7394fb3930266c577c02 (patch)
tree8ac057a7f2da06af633771c1bc972d8faba61235 /perl/Git
parent63a35025b11bf0e7ef39693aeea3b639a066b7b8 (diff)
Git/SVN: die when there is no commit metadata
When passing a bad --trunk option to `git svn clone`, like for example the same URL that we are cloning: C:\Windows\system32>git svn clone --no-metadata -A c:\temp\svn_to_git_users.txt --trunk= --tags= --branches= c:\code\Git_myproject One gets an "Use of uninitialized value $u in substitution (s///)" error: [...] W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF Contrib/src/Services W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/RealWorldControls/References r530 = c276e3b039d8e38759c6fb17443349732552d7a2 (refs/remotes/origin/trunk) Found possible branch point: =>, 529 Use of uninitialized value $u in substitution (s///) at /mingw32/share/perl5/site_perl/Git/ line 101. Use of uninitialized value $u in concatenation (.) or string at /mingw32/share/perl5/site_perl/Git/ line 101. refs/remotes/origin/trunk: '' not found in '' C:\Windows\system32> Let's fix that by just die()ing when we have an uninitialized value because we cannot get commit metadata from a ref. Signed-off-by: Christian Couder <> Signed-off-by: Eric Wong <>
Diffstat (limited to 'perl/Git')
1 files changed, 2 insertions, 1 deletions
diff --git a/perl/Git/ b/perl/Git/
index b2c14e2..d94d01c 100644
--- a/perl/Git/
+++ b/perl/Git/
@@ -97,7 +97,8 @@ sub resolve_local_globs {
"existing: $existing\n",
" globbed: $refname\n";
- my $u = (::cmt_metadata("$refname"))[0];
+ my $u = (::cmt_metadata("$refname"))[0] or die
+ "$refname: no associated commit metadata\n";
$u =~ s!^\Q$url\E(/|$)!! or die
"$refname: '$url' not found in '$u'\n";
if ($pathname ne $u) {