chiark / gitweb /
git-debrebase: merge: test: Introduce t-merge-conflicted-*
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 15:51:54 +0000 (16:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 16:05:56 +0000 (17:05 +0100)
NFC

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

index 6028133..e2496b4 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}
index b1a215a..6014691 100755 (executable)
@@ -32,13 +32,7 @@ echo 'us-conflict' >>debian/zorkmid
 git commit -m 'us-conflict' debian/zorkmid
 t-git-debrebase quick
 
-t-expect-fail E:'Merge conflict in debian/zorkmid' \
-git merge other
-
-perl -i~ -ne 'print unless m{^(?:\<\<\<|\>\>\>|===)}' debian/zorkmid
-
-git add debian/zorkmid
-git commit --no-edit
+t-merge-conflicted-stripping-conflict-markers other debian/zorkmid
 
 t-expect-fail E:'general two-parent merge' \
 t-git-debrebase