#!/bin/bash
set -e
. tests/lib
. $troot/lib-gdr

t-dependencies GDR

t-tstunt-parsechangelog

t-archive example 1.0-1
t-git-none

t-dgit clone $p

cd $p

t-git-debrebase status

t-expect-fail E:'bare dgit dsc import' \
t-git-debrebase

LC_MESSAGES=C t-git-debrebase status |tee ../bare-output
grep 'bare dgit dsc import with no prior history' ../bare-output

git branch before

t-expect-fail E:'Could not find or construct a suitable upstream commit' \
t-git-debrebase convert-from-dgit-view --no-origs

t-git-debrebase convert-from-dgit-view
t-gdr-good laundered

t-expect-fail E:'already seems to be in git-debrebase format' \
t-git-debrebase convert-from-dgit-view

t-refs-same-start
t-ref-head
t-git-debrebase --noop-ok convert-from-dgit-view
t-ref-head

t-git-debrebase -falready-converted convert-from-dgit-view \
	 --always-convert-anyway
t-expect-fail E:'ref varies' t-ref-head
t-gdr-good laundered

t-ok
