From: Ian Jackson Date: Sat, 10 Aug 2019 18:11:57 +0000 (+0100) Subject: dgit: Break out vcs_git_url_of_ctrl X-Git-Tag: archive/debian/9.7~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d81b1debc1dc1ff0d123e3e4bc244b26592d1a52;p=dgit.git dgit: Break out vcs_git_url_of_ctrl This should have been done before. No functional change so far. Signed-off-by: Ian Jackson --- diff --git a/dgit b/dgit index 0775a7c1..687ef646 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);