#!/bin/bash
set -e
. tests/lib

t-restrict x-dgit-skip-suite,bullseye
t-restrict x-dgit-skip-suite,buster
t-dependencies T2U DEBORIG GDR

t-setup-import gdr-convert-gbp

v=2.0-3

t-t2u-settings
t-debpolicy

cd $p

# Remove d/patches from the maintainer view so we have a real split.
t-git-debrebase
DEBEMAIL=dgit-tests@example.org \
    gbp dch --commit --qa \
    --ignore-branch --release --spawn-editor=never
t-git-debrebase stitch

t-t2u-setup-repo

# TODO Make split.b ref.

tagname=test-dummy/$v

# Check that the thing we are about to tag (still) lacks d/patches.
test ! -e debian/patches
# And, debpush it.
t-t2u-test --quilt=linear
t-t2u-succeeded

git branch split.p dgit/dgit/sid

# TODO Run an appropriate t-*-pushed-good.

t-t2u-gittarxz-unpack
t-git-debrebase make-patches
git branch split.t
t-t2u-gittarxz-reproduced

t-ok
