Code

git-svn: detect and fail gracefully when dcommitting to a void
[git.git] / git-svn.perl
index b1510495a7f003991a37d0810c551404c6c1252c..711e7b7eb9274c9de292d6f36fca9a9f0baf6318 100755 (executable)
@@ -410,10 +410,12 @@ sub cmd_dcommit {
        $head ||= 'HEAD';
        my @refs;
        my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
-       print "Committing to $url ...\n";
+       if ($url) {
+               print "Committing to $url ...\n";
+       }
        unless ($gs) {
                die "Unable to determine upstream SVN information from ",
-                   "$head history\n";
+                   "$head history.\nPerhaps the repository is empty.";
        }
        my $last_rev;
        my ($linear_refs, $parents) = linearize_history($gs, \@refs);