#!/bin/sh
set -e

cd "$AUTOPKGTEST_TMP"

mkdir old new
printf 'hello\n' > old/example.txt
printf 'hello\nDebian autopkgtest\n' > new/example.txt

mkdir new/docs
printf 'new file\n' > new/docs/notes.txt

makepatch -quiet -description autopkgtest old new > update.patch
test -s update.patch

cp -a old patched
applypatch -dir patched update.patch

diff -ru new patched
