chiark / gitweb /
dgit: clone: Create destination directory before using network
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Jan 2019 21:15:49 +0000 (21:15 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Jan 2019 21:15:49 +0000 (21:15 +0000)
We are going to want to check the bpd (apropos of #913648), which
might be a relative path.  We should fail quickly in this case.

No significant functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 922d719642ea38783b9fcb3abd179a60ec0c6c48..b25d344f46a496516735dd9cb088cd76008c7341 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3758,10 +3758,12 @@ sub clone ($) {
     }
     printdebug "clone main body\n";
 
-    canonicalise_suite();
-    my $hasgit = check_for_git();
     mkdir $dstdir or fail f_ "create \`%s': %s", $dstdir, $!;
     changedir $dstdir;
+
+    canonicalise_suite();
+    my $hasgit = check_for_git();
+
     runcmd @git, qw(init -q);
     record_maindir();
     setup_new_tree();