chiark / gitweb /
git-debrebase: merge: test: Introduce t-merge-conflicted-*
[dgit.git] / tests / lib
index 6028133a21b38bd6518e0bc7bad1471581ca25be..e2496b43a0355d45f67fc345622df66705c8de33 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -1025,6 +1025,18 @@ t-make-badcommit () {
        t-expect-fsck-fail $badcommit
 }
 
+t-merge-conflicted-stripping-conflict-markers () {
+       local otherbranch=$1
+       local file=$2
+
+       t-expect-fail F:"Merge conflict in $file" \
+       git merge $otherbranch
+
+       perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' "$file"
+       git add "$file"
+       git commit --no-edit
+}
+
 t-commit () {
        local msg=$1
        v=${2:-${majorv:-1}.$revision}