From aa763397e6222caf15f1f4c86e05162b8764f3dc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 17 Nov 2013 15:05:35 +0000 Subject: autopkgtests: break out fetch-nogit --- tests/lib | 16 +++++++++++++--- tests/tests/clone-nogit | 7 +------ tests/tests/fetch-nogit | 16 ++++++++++++++++ tests/worktrees/pari-extra_3-1.tar | Bin 0 -> 71680 bytes 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100755 tests/tests/fetch-nogit create mode 100644 tests/worktrees/pari-extra_3-1.tar diff --git a/tests/lib b/tests/lib index 5ce17d6..8823b28 100644 --- 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 diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit index 709aa1f..978afb8 100755 --- a/tests/tests/clone-nogit +++ b/tests/tests/clone-nogit @@ -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 index 0000000..7937a6f --- /dev/null +++ b/tests/tests/fetch-nogit @@ -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 index 0000000..115a795 Binary files /dev/null and b/tests/worktrees/pari-extra_3-1.tar differ -- cgit v1.2.3