chiark / gitweb /
git-debrebase: merge: test conflict: Test resolution via patch
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 00:16:46 +0000 (01:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 00:50:01 +0000 (01:50 +0100)
This is a really horrible way to do things.  We need a better
way to let the user help resolve this kind of merge.

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

index 12e7055..71be280 100755 (executable)
@@ -91,6 +91,7 @@ git checkout master
 git reset --hard master-before-merge
 
 t-merge-conflicted-stripping-conflict-markers other docs/README
+t-git-debrebase stitch
 
 : ----- expect failure -----
 
@@ -101,22 +102,48 @@ t-git-debrebase
 
 wreckage-after
 
-: ----- resolve the conflict -----
+: ===== resolve the conflict =====
 
 # omg
-git checkout debrebase/wreckage/merged-patchqueue
-QUILT_PATCHES=debian/patches quilt push -a
-QUILT_PATCHES=debian/patches quilt refresh
-git add debian/patches
-git commit -m FIX
-git reset --hard
-git clean -xdff
 
-t-git-debrebase record-resolved-merge
+quilt_faff_before () {
+       git checkout -b fix$1 debrebase/wreckage/merged-patchqueue
+       QUILT_PATCHES=debian/patches quilt push -a
+}
+quilt_faff_after () {
+       QUILT_PATCHES=debian/patches quilt refresh
+       git add debian/patches
+       git commit -m FIX
+       git reset --hard
+       git clean -xdff
+       t-git-debrebase record-resolved-merge
+       git checkout master
+}
 
-git checkout master
+: ----- badly -----
+
+quilt_faff_before 1
+quilt_faff_after
+
+t-expect-fail E:'upstream files are not the same' \
+t-git-debrebase
+
+t-git-debrebase scrap
+no-wreckage
+
+: ----- well -----
+
+t-expect-fail F:'docs/README' \
+t-git-debrebase
+wreckage-after
+
+quilt_faff_before 2
+git checkout master docs/README
+git reset docs/README
+quilt_faff_after
+
+t-git-debrebase
 
-#t-git-debrebase
-#t-gdr-good laundered
+t-gdr-good laundered
 
 t-ok