summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit20
1 files changed, 13 insertions, 7 deletions
diff --git a/dgit b/dgit
index 25afa67..fa09ca3 100755
--- a/dgit
+++ b/dgit
@@ -638,11 +638,14 @@ sub access_gituserhost () {
return access_someuserhost('git');
}
-sub access_giturl () {
+sub access_giturl (;$) {
+ my ($optional) = @_;
my $url = access_cfg('git-url','RETURN-UNDEF');
if (!defined $url) {
+ my $proto = access_cfg('git-proto', 'RETURN-UNDEF');
+ return undef unless defined $proto;
$url =
- access_cfg('git-proto').
+ $proto.
access_gituserhost().
access_cfg('git-path');
}
@@ -1326,11 +1329,14 @@ sub clone ($) {
mkdir $dstdir or die "$dstdir $!";
changedir $dstdir;
runcmd @git, qw(init -q);
- runcmd @git, qw(config), "remote.$remotename.fetch", fetchspec();
- open H, "> .git/HEAD" or die $!;
- print H "ref: ".lref()."\n" or die $!;
- close H or die $!;
- runcmd @git, qw(remote add), 'origin', access_giturl();
+ my $giturl = access_giturl(1);
+ if (defined $giturl) {
+ runcmd @git, qw(config), "remote.$remotename.fetch", fetchspec();
+ open H, "> .git/HEAD" or die $!;
+ print H "ref: ".lref()."\n" or die $!;
+ close H or die $!;
+ runcmd @git, qw(remote add), 'origin', $giturl;
+ }
if (check_for_git()) {
progress "fetching existing git history";
git_fetch_us();