From: Thomas Rast Date: Sun, 31 Aug 2008 13:50:59 +0000 (+0200) Subject: git svn: catch lack of upstream info for dcommit earlier X-Git-Tag: v1.6.1-rc1~262^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2cb611054a9597a00e9387c77e75d82e78982e60;p=git.git git svn: catch lack of upstream info for dcommit earlier Since 711521e 'git svn dcommit' attempts to use the upstream information to determine the SVN URL, before it verifies that it even found an upstream. Move up the corresponding check. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- diff --git a/git-svn.perl b/git-svn.perl index 2d355c183..484b4ab0d 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -421,15 +421,15 @@ sub cmd_dcommit { $head ||= 'HEAD'; my @refs; my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs); + unless ($gs) { + die "Unable to determine upstream SVN information from ", + "$head history.\nPerhaps the repository is empty."; + } $url = defined $_commit_url ? $_commit_url : $gs->full_url; my $last_rev = $_revision if defined $_revision; if ($url) { print "Committing to $url ...\n"; } - unless ($gs) { - die "Unable to determine upstream SVN information from ", - "$head history.\nPerhaps the repository is empty."; - } my ($linear_refs, $parents) = linearize_history($gs, \@refs); if ($_no_rebase && scalar(@$linear_refs) > 1) { warn "Attempting to commit more than one change while ",