chiark / gitweb /
git-debrebase: Change exit status for patch amendments, to 7
[dgit.git] / tests / lib-gdr
index 9a23cd5bab5085db3a3b55f37d6fad5277c62100..b60ccb8ed2f69b996989fd5c6ef5b2b6bf62d423 100644 (file)
@@ -18,12 +18,24 @@ t-gdr-good () {
        # state should be one of
        #   laundered
        #   stitched
-       #   patches
+       #   pushed
 
        git diff --quiet ${beforetag-t.before} -- ':.' ':!debian/patches'
 
        local etype netype bwtip
 
+       LC_MESSAGES=C t-git-debrebase status >../status.check
+       case $state in
+       laundered)
+               egrep '^  *branch is laundered' ../status.check
+               ;;
+       stitched|pushed)
+               egrep \
+ '^  *branch contains furniture|^  *branch is unlaundered|^  *branch needs laundering' ../status.check
+               egrep '^  stitched$' ../status.check
+               ;;
+       esac
+
        case $state in
        laundered)
                        etype=Upstream
@@ -78,6 +90,16 @@ t-gdr-good () {
                        enparents=2
                        git diff --quiet $expect..$cid
                        etype=Upstream
+
+                       : 'reject pointless pseudomerges'
+                       local overwritten=${parents/$expect/}
+                       overwritten=${overwritten// /}
+                       t-git-debrebase analyse $overwritten >../anal.overwr
+                       local ocid otype oinfo
+                       read <../anal.overwr ocid otype oinfo
+                       case "$otype" in
+                       Pseudomerge) test "x$info" != "x$oinfo" ;;
+                       esac
                        ;;
                Packaging)
                        git diff --quiet $expect..$cid -- ':.' ':!debian'