chiark / gitweb /
Infra: dgit-ssh-dispatch: Break out serve_up (nfc)
[dgit.git] / tests / lib
index 5b93d98dc86b074d71080106cf9ca35a8ec43e9c..0b0ae47280f0158efd3471ccf869d25afe6c1414 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -302,6 +302,16 @@ t-clean-on-branch () {
        t-output "## $1" git status -b --porcelain
 }
 
+t-git-get-ref-exact () {
+       local ref=$1
+       # does not dereference, unlike t-git-get-ref
+       case "$ref" in
+       refs/*) ;;
+       *) fail "t-git-get-ref-exact bad $ref" ;;
+       esac
+       git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
+}
+
 t-git-get-ref () {
        local ref=$1
        case "$ref" in
@@ -423,6 +433,15 @@ t-tstunt-parsechangelog () {
        t-tstunt dpkg-parsechangelog Dpkg/Changelog/Parse.pm
 }
 
+t-prep-mergechangelogs () {
+       local b=merge.dpkg-mergechangelogs
+       git config $b.name 'debian/changelog merge driver'
+       git config $b.driver 'dpkg-mergechangelogs -m %O %A %B %A'
+       mkdir -p .git/info
+       echo >>.git/info/attributes \
+               'debian/changelog merge=dpkg-mergechangelogs'
+}
+
 t-ref-dsc-dgit () {
        local dsc=${p}_${v}.dsc
        local val=`t-822-field $tmp/incoming/$dsc Dgit`