aboutsummaryrefslogtreecommitdiffstats
path: root/t/interactive-multiple-commands
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-09-22 19:53:29 +0200
committerMattias Andrée <m@maandree.se>2026-09-22 19:53:29 +0200
commitd8de1b23e8ec896759424a2f146969783cdd89e3 (patch)
treeed1ea3e97add5116230fd2df34e42b829a70ab39 /t/interactive-multiple-commands
parentfix doc text (diff)
downloadgit-rediff-1.1.tar.gz
git-rediff-1.1.tar.bz2
git-rediff-1.1.tar.xz
Add conflcit resultions strategies and interactive mode, and a lot of testsHEAD1.1master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 't/interactive-multiple-commands')
-rwxr-xr-xt/interactive-multiple-commands113
1 files changed, 113 insertions, 0 deletions
diff --git a/t/interactive-multiple-commands b/t/interactive-multiple-commands
new file mode 100755
index 0000000..a279541
--- /dev/null
+++ b/t/interactive-multiple-commands
@@ -0,0 +1,113 @@
+#!/bin/sh -e
+. t/common.sh
+interactive
+
+printf '%s\n' > file \
+ "${HEAD} ours" \
+ head \
+ "${PARENT} base" \
+ base \
+ "${TAIL}" \
+ tail \
+ "${END} theirs" \
+ "${HEAD} ours" \
+ head \
+ "${PARENT} base" \
+ base \
+ "${TAIL}" \
+ tail \
+ "${END} theirs" \
+ "${HEAD} ours" \
+ head \
+ "${PARENT} base" \
+ base \
+ "${TAIL}" \
+ tail \
+ "${END} theirs" \
+ "${HEAD} ours" \
+ first \
+ "${PARENT} base" \
+ not first \
+ "${TAIL}" \
+ not first \
+ "${END} theirs" \
+ "${HEAD} ours" \
+ ours \
+ common \
+ "${PARENT} base" \
+ base \
+ common \
+ "${TAIL}" \
+ theirs \
+ common \
+ "${END} theirs"
+
+printf '%s\n' > file.expected \
+ head \
+ tail \
+ "${HEAD} ours" \
+ head \
+ "${TAIL}" \
+ tail \
+ "${END} theirs" \
+ first \
+ "${HEAD} ours" \
+ ours \
+ "${PARENT} base" \
+ base \
+ "${TAIL}" \
+ theirs \
+ "${END} theirs" \
+ common
+
+(
+ interactive_marker "${HEAD} ours"
+ interactive_side head
+ interactive_marker "${PARENT} base"
+ interactive_base base
+ interactive_marker "${TAIL}"
+ interactive_side tail
+ interactive_marker "${END} theirs"
+ interactive_prompt 1 5
+ interactive_marker "${HEAD} ours"
+ interactive_side head
+ interactive_marker "${PARENT} base"
+ interactive_base base
+ interactive_marker "${TAIL}"
+ interactive_side tail
+ interactive_marker "${END} theirs"
+ interactive_prompt 2 5
+ interactive_marker "${HEAD} ours"
+ interactive_side head
+ interactive_marker "${PARENT} base"
+ interactive_base base
+ interactive_marker "${TAIL}"
+ interactive_side tail
+ interactive_marker "${END} theirs"
+ interactive_prompt 3 5
+ interactive_marker "${HEAD} ours"
+ interactive_side first
+ interactive_marker "${PARENT} base"
+ interactive_base not
+ interactive_base first
+ interactive_marker "${TAIL}"
+ interactive_side not
+ interactive_side first
+ interactive_marker "${END} theirs"
+ interactive_prompt 4 5
+ interactive_marker "${HEAD} ours"
+ interactive_side ours
+ interactive_side common
+ interactive_marker "${PARENT} base"
+ interactive_base base
+ interactive_base common
+ interactive_marker "${TAIL}"
+ interactive_side theirs
+ interactive_side common
+ interactive_marker "${END} theirs"
+ interactive_prompt 5 5
+) > output.expected
+
+printf '%s' htbmr > input
+conflict --interactive file 8<input 9>output
+diff -u -- output.expected output >&2