chiark / gitweb /
Memoise git config lookups (big speedup!)
[dgit.git] / tests / lib
index 118c497115e9f1ac96198a6c7b392653215cc394..1179fb093f8ed48535c60a5eaaf52fc7ae9de481 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -111,11 +111,12 @@ t-git-objects-not-present () {
 
 t-reporefs () {
        local whichoutput=$1; shift
+       local whichrepo=${1-$dgitrepo}
        local outputfile="$tmp/show-refs.$whichoutput"
        (set -e
         exec >"$outputfile"
-        if test -d $dgitrepo; then
-               cd $dgitrepo
+        if test -d $whichrepo; then
+               cd $whichrepo
                git show-ref |sort
        fi)
 }
@@ -300,6 +301,15 @@ t-diff-nogit () {
        diff --exclude=.git --exclude=.pc -ruN $*
 }
 
+t-files-notexist () {
+       local f
+       for f in "$@"; do
+               if [ -e $f ]; then
+                       fail "$f exists!"
+               fi
+       done
+}
+
 t-cloned-fetched-good () {
        t-diff-nogit ../extract/$p-${v%-*} .
        t-clean-on-branch dgit/sid
@@ -426,6 +436,16 @@ t-pushed-good () {
        git verify-tag `t-v-tag`
 }
 
+t-commit-build-push-expect-log () {
+       local msg=$1
+       local mpat=$2
+       t-commit "$msg"
+       t-dgit build
+       LC_MESSAGES=C \
+       t-dgit push --new 2>&1 |tee $tmp/push.log
+       t-grep-mpat "$mpat" $tmp/push.log
+}
+
 t-822-field () {
        local file=$1
        local field=$2