chiark / gitweb /
autopkgtests: break out fetch-nogit
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Nov 2013 15:05:35 +0000 (15:05 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Nov 2013 17:45:27 +0000 (17:45 +0000)
tests/lib
tests/tests/clone-nogit
tests/tests/fetch-nogit [new file with mode: 0755]
tests/worktrees/pari-extra_3-1.tar [new file with mode: 0644]

index 5ce17d6c56c36c22137d97ebdfc1413efbbb958f..8823b287ba555d873f30405b84b59aee1b9eb8e8 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -22,15 +22,25 @@ ln $troot/ssh ssh
 mkdir $tmp/gnupg
 export GNUPGHOME=$tmp/gnupg
 
-t-git () {
-       mkdir -p $tmp/git
-       cp -al $troot/git-srcs/$1 git/.
+t-worktree () {
+       rm -rf $p
+       tar xf $troot/worktrees/${p}_$1.tar
 }
 
 t-git-none () {
        mkdir -p $tmp/git
 }
 
+t-has-ancestor () {
+       local ancestor=`git rev-parse $1`
+       local now=`git rev-parse HEAD`
+       local mbase=`git merge-base $ancestor $now`
+       if [ x$mbase != x$ancestor ]; then
+               echo "not ff $ancestor..$now, $mbase != $ancestor"
+               exit 1
+       fi
+}      
+
 t-archive () {
        p=$1
        v=$2
index 709aa1fa4947edebbe0e4ced07cbf8aa42e0b566..978afb8eca4866eac737aeb480945a2b077baaa0 100755 (executable)
@@ -2,17 +2,12 @@
 set -e
 . tests/lib
 
-t-git-none
 t-archive pari-extra 3-1
+t-git-none
 
 t-dgit clone $p
 
 cd $p
 t-cloned-fetched-good
 
-t-archive pari-extra 3-2~dummy1
-
-t-dgit pull
-t-cloned-fetched-good
-
 echo ok
diff --git a/tests/tests/fetch-nogit b/tests/tests/fetch-nogit
new file mode 100755 (executable)
index 0000000..7937a6f
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-archive pari-extra 3-2~dummy1
+t-git-none
+t-worktree 3-1
+cd $p
+old=`git rev-parse HEAD`
+
+t-dgit pull
+
+t-cloned-fetched-good
+t-has-ancestor $old
+
+echo ok
diff --git a/tests/worktrees/pari-extra_3-1.tar b/tests/worktrees/pari-extra_3-1.tar
new file mode 100644 (file)
index 0000000..115a795
Binary files /dev/null and b/tests/worktrees/pari-extra_3-1.tar differ