summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-11-08 16:04:07 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-11-08 22:22:21 +0000
commita6c314119abf6563de1651764756a46e169e6716 (patch)
treeea5f094d05fa127b2501f32af600571feb7dea11 /dgit
parent66447d5768f417db95455364f31d97626db6247c (diff)
clone: Check for git earlier
check_for_git is going to maybe want to change the git-url, so run it sooner. No substantial functional change.
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit3
1 files changed, 2 insertions, 1 deletions
diff --git a/dgit b/dgit
index 38b02e4..4c8a09d 100755
--- a/dgit
+++ b/dgit
@@ -1377,6 +1377,7 @@ sub clone ($) {
my ($dstdir) = @_;
canonicalise_suite();
badusage "dry run makes no sense with clone" unless act_local();
+ my $hasgit = check_for_git();
mkdir $dstdir or die "$dstdir $!";
changedir $dstdir;
runcmd @git, qw(init -q);
@@ -1388,7 +1389,7 @@ sub clone ($) {
close H or die $!;
runcmd @git, qw(remote add), 'origin', $giturl;
}
- if (check_for_git()) {
+ if ($hasgit) {
progress "fetching existing git history";
git_fetch_us();
runcmd_ordryrun_local @git, qw(fetch origin);