chiark / gitweb /
test suite: gdr-new-upstream: Break out clog-check-[12]
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Aug 2018 15:39:24 +0000 (16:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Aug 2018 00:20:44 +0000 (01:20 +0100)
NFC

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/gdr-newupstream

index ed80554..b45a0bf 100755 (executable)
@@ -28,21 +28,31 @@ git tag v2.1 upstream
 
 git branch before-new-upstream
 
+clog-check-1 () {
+       before=$1
+       date=$(git log --format=%aD -n1 debian/changelog)
+       git show $before:debian/changelog >../clog.before
+       m="  * Update to new upstream version ${v%-*}."
+       e="dgit test git user <dgit-test@debian.example.net>  $date"
+}
+clog-check-2 () {
+       diff -u ../clog.expected debian/changelog
+}
+
 : ----- ordinary new upstream test -----
 
 t-git-debrebase new-upstream ${v%-*}
 
-date=$(git log --format=%aD -n1 debian/changelog)
-cat >../clog.expected <<END
+clog-check-1 before-new-upstream
+cat - <<END ../clog.before >../clog.expected
 example ($v) UNRELEASED; urgency=medium
 
-  * Update to new upstream version ${v%-*}.
+$m
 
- -- dgit test git user <dgit-test@debian.example.net>  $date
+ -- $e
 
 END
-git show before-new-upstream:debian/changelog >>../clog.expected
-diff -u ../clog.expected debian/changelog
+clog-check-2
 
 t-gdr-good laundered
 git reflog | egrep 'debrebase new-upstream.*checkout'