about summary refs log tree commit diff
path: root/third_party/git/t/t3430-rebase-merges.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/t/t3430-rebase-merges.sh')
-rwxr-xr-xthird_party/git/t/t3430-rebase-merges.sh81
1 files changed, 14 insertions, 67 deletions
diff --git a/third_party/git/t/t3430-rebase-merges.sh b/third_party/git/t/t3430-rebase-merges.sh
index a1bc3e2001..7b6c4847ad 100755
--- a/third_party/git/t/t3430-rebase-merges.sh
+++ b/third_party/git/t/t3430-rebase-merges.sh
@@ -20,11 +20,12 @@ Initial setup:
 '
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-rebase.sh
-. "$TEST_DIRECTORY"/lib-log-graph.sh
 
 test_cmp_graph () {
 	cat >expect &&
-	lib_test_cmp_graph --boundary --format=%s "$@"
+	git log --graph --boundary --format=%s "$@" >output &&
+	sed "s/ *$//" <output >output.trimmed &&
+	test_cmp expect output.trimmed
 }
 
 test_expect_success 'setup' '
@@ -36,27 +37,20 @@ test_expect_success 'setup' '
 	test_commit A &&
 	git checkout -b first &&
 	test_commit B &&
-	b=$(git rev-parse --short HEAD) &&
 	git checkout master &&
 	test_commit C &&
-	c=$(git rev-parse --short HEAD) &&
 	test_commit D &&
-	d=$(git rev-parse --short HEAD) &&
 	git merge --no-commit B &&
 	test_tick &&
 	git commit -m E &&
 	git tag -m E E &&
-	e=$(git rev-parse --short HEAD) &&
 	git checkout -b second C &&
 	test_commit F &&
-	f=$(git rev-parse --short HEAD) &&
 	test_commit G &&
-	g=$(git rev-parse --short HEAD) &&
 	git checkout master &&
 	git merge --no-commit G &&
 	test_tick &&
 	git commit -m H &&
-	h=$(git rev-parse --short HEAD) &&
 	git tag -m H H &&
 	git checkout A &&
 	test_commit conflicting-G G.t
@@ -99,24 +93,24 @@ test_expect_success 'create completely different structure' '
 '
 
 test_expect_success 'generate correct todo list' '
-	cat >expect <<-EOF &&
+	cat >expect <<-\EOF &&
 	label onto
 
 	reset onto
-	pick $b B
+	pick d9df450 B
 	label E
 
 	reset onto
-	pick $c C
+	pick 5dee784 C
 	label branch-point
-	pick $f F
-	pick $g G
+	pick ca2c861 F
+	pick 088b00a G
 	label H
 
 	reset branch-point # C
-	pick $d D
-	merge -C $e E # E
-	merge -C $h H # H
+	pick 12bd07b D
+	merge -C 2051b56 E # E
+	merge -C 233d48a H # H
 
 	EOF
 
@@ -157,6 +151,7 @@ test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
 	test_path_is_file .git/rebase-merge/patch
 '
 
+SQ="'"
 test_expect_success 'failed `merge <branch>` does not crash' '
 	test_when_finished "test_might_fail git rebase --abort" &&
 	git checkout conflicting-G &&
@@ -345,7 +340,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
 	git merge --allow-unrelated-histories khnum &&
 	test_tick &&
 	git rebase -f -r HEAD^ &&
-	test_cmp_rev ! HEAD^2 khnum &&
+	! test_cmp_rev HEAD^2 khnum &&
 	test_cmp_graph HEAD^.. <<-\EOF &&
 	*   Merge branch '\''khnum'\'' into asherah
 	|\
@@ -407,7 +402,7 @@ test_expect_success 'octopus merges' '
 	| | * three
 	| * | two
 	| |/
-	* / one
+	* | one
 	|/
 	o before-octopus
 	EOF
@@ -446,52 +441,4 @@ test_expect_success '--continue after resolving conflicts after a merge' '
 	test_path_is_missing .git/MERGE_HEAD
 '
 
-test_expect_success '--rebase-merges with strategies' '
-	git checkout -b with-a-strategy F &&
-	test_tick &&
-	git merge -m "Merge conflicting-G" conflicting-G &&
-
-	: first, test with a merge strategy option &&
-	git rebase -ir -Xtheirs G &&
-	echo conflicting-G >expect &&
-	test_cmp expect G.t &&
-
-	: now, try with a merge strategy other than recursive &&
-	git reset --hard @{1} &&
-	write_script git-merge-override <<-\EOF &&
-	echo overridden$1 >>G.t
-	git add G.t
-	EOF
-	PATH="$PWD:$PATH" git rebase -ir -s override -Xxopt G &&
-	test_write_lines G overridden--xopt >expect &&
-	test_cmp expect G.t
-'
-
-test_expect_success '--rebase-merges with commit that can generate bad characters for filename' '
-	git checkout -b colon-in-label E &&
-	git merge -m "colon: this should work" G &&
-	git rebase --rebase-merges --force-rebase E
-'
-
-test_expect_success '--rebase-merges with message matched with onto label' '
-	git checkout -b onto-label E &&
-	git merge -m onto G &&
-	git rebase --rebase-merges --force-rebase E &&
-	test_cmp_graph <<-\EOF
-	*   onto
-	|\
-	| * G
-	| * F
-	* |   E
-	|\ \
-	| * | B
-	* | | D
-	| |/
-	|/|
-	* | C
-	|/
-	* A
-	EOF
-'
-
 test_done