X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Flib;h=275d3ef3f2824e89dc64453f41a106d133f5619d;hb=45cc7d295cb818a2c236687d9d395d4712e500ce;hp=7c52788274ba7fd04edee2024bab3b86d1d20bc6;hpb=fb632e4f36ad204600c88406acd5d252c81d8bf1;p=dgit.git diff --git a/tests/lib b/tests/lib index 7c527882..275d3ef3 100644 --- a/tests/lib +++ b/tests/lib @@ -21,6 +21,8 @@ END trap 'test $? = 0 || t-report-failure' EXIT +t-filter-out-git-hyphen-dir + t-set-intree : ${DGIT_TEST_DEBUG=-D} @@ -228,7 +230,7 @@ t-archive-none () { >$tmp/aq/package.new.$p t-archive-updated new $p - ln -s $suite $tmp/aq/dsc_in_suite/$sname + ln -sf $suite $tmp/aq/dsc_in_suite/$sname cat <>$tmp/aq/suites $jsondelim @@ -656,6 +658,19 @@ t-gbp-pushed-good () { t-splitbrain-pushed-good-end-made-dep14 } +t-unapplied-pushed-good () { + t-splitbrain-pushed-good-start + t-splitbrain-pushed-good--unpack --skip-patches + t-splitbrain-pushed-good-end-made-dep14 +} + +t-dpm-pushed-good () { + t-splitbrain-pushed-good-start + t-splitbrain-pushed-good--unpack + t-splitbrain-rm-gitignore-patch + t-splitbrain-pushed-good-end-made-dep14 +} + t-commit-build-push-expect-log () { local msg=$1 local mpat=$2 @@ -683,11 +698,13 @@ t-stunt-envvar () { local var=$1 local tstunt=$2 eval ' - case "'$var'" in + case "$'$var'" in "$tstunt:"*) ;; *":$tstunt:"*) ;; + "") '$var'="$tstunt" ;; *) '$var'="$tstunt:$'$var'" ;; esac + export '$var' ' } @@ -749,6 +766,18 @@ t-gbp-unapplied-pq2qc () { git commit -m 'Commit patch queue' } +t-git-pseudo-merge () { + # like git merge -s ours + if [ ! "$git_pseuomerge_opts" ]; then + if git merge --help \ + | grep -q allow-unrelated-histories; then + git_pseuomerge_opts='--allow-unrelated-histories' + fi + git_pseuomerge_opts+=' -s ours' + fi + git merge $git_pseuomerge_opts "$@" +} + t-gbp-example-prep () { t-tstunt-parsechangelog t-archive example 1.0-1 @@ -759,7 +788,7 @@ t-gbp-example-prep () { t-dgit fetch - git-checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip + git checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip gbp pq rebase echo '/* some comment */' >>src.c @@ -770,7 +799,7 @@ t-gbp-example-prep () { t-commit 'some updates' 1.0-2 - git merge -s ours \ + t-git-pseudo-merge \ -m 'Pseudo-merge to make descendant of archive' \ remotes/dgit/dgit/sid } @@ -817,7 +846,7 @@ t-drs () { t-newtag () { export tagpfx=archive/test-dummy - t-git-config dgit-distro.test-dummy.dgit-tag-format new + t-git-config dgit-distro.test-dummy.dgit-tag-format new,maint } t-oldtag () { t-git-config dgit-distro.test-dummy.dgit-tag-format old