summaryrefslogtreecommitdiff
path: root/tests/tests/badcommit-rewrite
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests/badcommit-rewrite')
-rwxr-xr-xtests/tests/badcommit-rewrite36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/tests/badcommit-rewrite b/tests/tests/badcommit-rewrite
new file mode 100755
index 0000000..bcec8e6
--- /dev/null
+++ b/tests/tests/badcommit-rewrite
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-setup-import examplegit
+
+cd example
+
+suite=stable
+
+t-commit 'No changes, just send to stable' '' stable
+
+t-make-badcommit
+git reset --hard $badcommit
+
+t-dgit -wgf build
+t-dgit push --overwrite=1.2 stable
+t-archive-process-incoming stable
+
+rstable=refs/remotes/dgit/dgit/stable
+
+t-dgit fetch stable
+t-has-parent-or-is $rstable $badcommit
+
+cd $tmp/git/$p.git
+${DGIT_BADCOMMIT_FIXUP} --real
+
+cd $tmp/$p
+${DGIT_BADCOMMIT_FIXUP} --real
+
+t-dgit fetch stable
+
+t-expect-fail "child $rstable lacks parent $badcommit" \
+t-has-parent-or-is $rstable $badcommit
+
+t-ok