X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=d57b64351e1883f78772e9ae075be814f0bee8c4;hb=7593c9b857a3d4517d8772ff0e31faf5cc3b4fb4;hp=0775a7c1f31a7337a2c57cde033d77b72af8a734;hpb=a4e8e4dbccd6fd64f7e31cf7527e9a8bd0bfe806;p=dgit.git diff --git a/dgit b/dgit index 0775a7c1..d57b6435 100755 --- a/dgit +++ b/dgit @@ -3848,6 +3848,15 @@ END printdone f_ "ready for work in %s", $dstdir; } +sub vcs_git_url_of_ctrl ($) { + my ($ctrl) = @_; + my $vcsgiturl = $ctrl->{'Vcs-Git'}; + if (length $vcsgiturl) { + $vcsgiturl =~ s/\s+-b\s+\S+//g; + } + return $vcsgiturl; +} + sub clone ($) { # in multisuite, returns twice! # once in parent after first suite fetched, @@ -3886,9 +3895,8 @@ sub clone ($) { progress __ "starting new git history"; } fetch_from_archive() or no_such_package; - my $vcsgiturl = $dsc->{'Vcs-Git'}; + my $vcsgiturl = vcs_git_url_of_ctrl $dsc; if (length $vcsgiturl) { - $vcsgiturl =~ s/\s+-b\s+\S+//g; runcmd @git, qw(remote add vcs-git), $vcsgiturl; } clone_finish($dstdir); @@ -4977,7 +4985,7 @@ sub cmd_update_vcs_git () { print STDERR f_ "changing vcs-git url to: %s\n", $url; @cmd = (@git, qw(remote set-url vcs-git), $url); } - runcmd_ordryrun_local @cmd; + runcmd_ordryrun_local @cmd if @cmd; if ($dofetch) { print f_ "fetching (%s)\n", "@ARGV"; runcmd_ordryrun_local @git, qw(fetch vcs-git), @ARGV;