chiark / gitweb /
Tests: t-prep-newpackage: Cope with source git which has a master already
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 May 2015 22:22:55 +0000 (23:22 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:12 +0000 (11:54 +0100)
tests/lib

index 1158f0a..abb2657 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -92,8 +92,10 @@ t-prep-newpackage () {
        t-git-none
        t-worktree $v
        cd $p
-       git branch -m dgit/sid master
-       git remote rm dgit
+       if ! git-show-ref --verify --quiet refs/heads/master; then
+               git branch -m dgit/sid master
+               git remote rm dgit
+       fi
        cd ..
 }