chiark / gitweb /
dgit: Make clone_set_head not depend on $giturl
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 7 Nov 2016 02:49:22 +0000 (02:49 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 7 Nov 2016 02:49:23 +0000 (02:49 +0000)
When cloning a distro which has no git server, correctly leave the
user on the local dgit branch, not on `master'.

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

index 7daf4f381bc153d8d496e60be4b320f16653ffd2..c8f815588f508748dca4ec1f33e4c6c2bcc857b9 100644 (file)
@@ -4,6 +4,8 @@ dgit (2.10~) unstable; urgency=medium
   * Test suite: Add fakeroot and make to Test-Depends.  These aren't
     necessarily pulled in by anything else.  (dpkg-dev Recommends
     build-essential.  But we don't actually need build-essential.)
+  * When cloning a distro which has no git server, correctly leave
+    the user on the local dgit branch, not on `master'.
 
  --
 
diff --git a/dgit b/dgit
index 0f9236cef4916d75191db2a1f3f41a662fafcb7c..f1a30c3a989a46748b770c070a040df654d9d94c 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3096,9 +3096,9 @@ sub clone ($) {
     mkdir $dstdir or fail "create \`$dstdir': $!";
     changedir $dstdir;
     runcmd @git, qw(init -q);
+    clone_set_head();
     my $giturl = access_giturl(1);
     if (defined $giturl) {
-       clone_set_head();
        runcmd @git, qw(remote add), 'origin', $giturl;
     }
     if ($hasgit) {