about summary refs log tree commit diff
path: root/third_party/git/t/t4300-merge-tree.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/t/t4300-merge-tree.sh')
-rwxr-xr-xthird_party/git/t/t4300-merge-tree.sh188
1 files changed, 94 insertions, 94 deletions
diff --git a/third_party/git/t/t4300-merge-tree.sh b/third_party/git/t/t4300-merge-tree.sh
index e59601e5fe9b..d87cc7d9efde 100755
--- a/third_party/git/t/t4300-merge-tree.sh
+++ b/third_party/git/t/t4300-merge-tree.sh
@@ -11,16 +11,16 @@ test_expect_success setup '
 '
 
 test_expect_success 'file add A, !B' '
-	git reset --hard initial &&
-	test_commit "add-a-not-b" "ONE" "AAA" &&
-	git merge-tree initial initial add-a-not-b >actual &&
-	cat >expected <<EXPECTED &&
+	cat >expected <<\EXPECTED &&
 added in remote
-  their  100644 $(git rev-parse HEAD:ONE) ONE
+  their  100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
 @@ -0,0 +1 @@
 +AAA
 EXPECTED
 
+	git reset --hard initial &&
+	test_commit "add-a-not-b" "ONE" "AAA" &&
+	git merge-tree initial initial add-a-not-b >actual &&
 	test_cmp expected actual
 '
 
@@ -41,15 +41,10 @@ test_expect_success 'file add A, B (same)' '
 '
 
 test_expect_success 'file add A, B (different)' '
-	git reset --hard initial &&
-	test_commit "add-a-b-diff-A" "ONE" "AAA" &&
-	git reset --hard initial &&
-	test_commit "add-a-b-diff-B" "ONE" "BBB" &&
-	git merge-tree initial add-a-b-diff-A add-a-b-diff-B >actual &&
-	cat >expected <<EXPECTED &&
+	cat >expected <<\EXPECTED &&
 added in both
-  our    100644 $(git rev-parse add-a-b-diff-A:ONE) ONE
-  their  100644 $(git rev-parse add-a-b-diff-B:ONE) ONE
+  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
+  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE
 @@ -1 +1,5 @@
 +<<<<<<< .our
  AAA
@@ -58,6 +53,11 @@ added in both
 +>>>>>>> .their
 EXPECTED
 
+	git reset --hard initial &&
+	test_commit "add-a-b-diff-A" "ONE" "AAA" &&
+	git reset --hard initial &&
+	test_commit "add-a-b-diff-B" "ONE" "BBB" &&
+	git merge-tree initial add-a-b-diff-A add-a-b-diff-B >actual &&
 	test_cmp expected actual
 '
 
@@ -69,18 +69,18 @@ test_expect_success 'file change A, !B' '
 '
 
 test_expect_success 'file change !A, B' '
-	git reset --hard initial &&
-	test_commit "change-not-a-b" "initial-file" "BBB" &&
-	git merge-tree initial initial change-not-a-b >actual &&
-	cat >expected <<EXPECTED &&
+	cat >expected <<\EXPECTED &&
 merged
-  result 100644 $(git rev-parse change-a-not-b:initial-file) initial-file
-  our    100644 $(git rev-parse initial:initial-file       ) initial-file
+  result 100644 ba629238ca89489f2b350e196ca445e09d8bb834 initial-file
+  our    100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
 @@ -1 +1 @@
 -initial
 +BBB
 EXPECTED
 
+	git reset --hard initial &&
+	test_commit "change-not-a-b" "initial-file" "BBB" &&
+	git merge-tree initial initial change-not-a-b >actual &&
 	test_cmp expected actual
 '
 
@@ -94,16 +94,11 @@ test_expect_success 'file change A, B (same)' '
 '
 
 test_expect_success 'file change A, B (different)' '
-	git reset --hard initial &&
-	test_commit "change-a-b-diff-A" "initial-file" "AAA" &&
-	git reset --hard initial &&
-	test_commit "change-a-b-diff-B" "initial-file" "BBB" &&
-	git merge-tree initial change-a-b-diff-A change-a-b-diff-B >actual &&
-	cat >expected <<EXPECTED &&
+	cat >expected <<\EXPECTED &&
 changed in both
-  base   100644 $(git rev-parse initial:initial-file          ) initial-file
-  our    100644 $(git rev-parse change-a-b-diff-A:initial-file) initial-file
-  their  100644 $(git rev-parse change-a-b-diff-B:initial-file) initial-file
+  base   100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
+  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d initial-file
+  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 initial-file
 @@ -1 +1,5 @@
 +<<<<<<< .our
  AAA
@@ -112,10 +107,34 @@ changed in both
 +>>>>>>> .their
 EXPECTED
 
+	git reset --hard initial &&
+	test_commit "change-a-b-diff-A" "initial-file" "AAA" &&
+	git reset --hard initial &&
+	test_commit "change-a-b-diff-B" "initial-file" "BBB" &&
+	git merge-tree initial change-a-b-diff-A change-a-b-diff-B >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'file change A, B (mixed)' '
+	cat >expected <<\EXPECTED &&
+changed in both
+  base   100644 f4f1f998c7776568c4ff38f516d77fef9399b5a7 ONE
+  our    100644 af14c2c3475337c73759d561ef70b59e5c731176 ONE
+  their  100644 372d761493f524d44d59bd24700c3bdf914c973c ONE
+@@ -7,7 +7,11 @@
+ AAA
+ AAA
+ AAA
++<<<<<<< .our
+ BBB
++=======
++CCC
++>>>>>>> .their
+ AAA
+ AAA
+ AAA
+EXPECTED
+
 	git reset --hard initial &&
 	test_commit "change-a-b-mix-base" "ONE" "
 AAA
@@ -140,26 +159,6 @@ AAA" &&
 		"$(sed -e "1{s/AAA/BBB/;}" -e "10{s/AAA/CCC/;}" <ONE)" &&
 	git merge-tree change-a-b-mix-base change-a-b-mix-A change-a-b-mix-B \
 		>actual &&
-
-	cat >expected <<EXPECTED &&
-changed in both
-  base   100644 $(git rev-parse change-a-b-mix-base:ONE) ONE
-  our    100644 $(git rev-parse change-a-b-mix-A:ONE   ) ONE
-  their  100644 $(git rev-parse change-a-b-mix-B:ONE   ) ONE
-@@ -7,7 +7,11 @@
- AAA
- AAA
- AAA
-+<<<<<<< .our
- BBB
-+=======
-+CCC
-+>>>>>>> .their
- AAA
- AAA
- AAA
-EXPECTED
-
 	test_cmp expected actual
 '
 
@@ -174,20 +173,20 @@ test_expect_success 'file remove A, !B' '
 '
 
 test_expect_success 'file remove !A, B' '
+	cat >expected <<\EXPECTED &&
+removed in remote
+  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
+  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
+@@ -1 +0,0 @@
+-AAA
+EXPECTED
+
 	git reset --hard initial &&
 	test_commit "rm-not-a-b-base" "ONE" "AAA" &&
 	git rm ONE &&
 	git commit -m "rm-not-a-b" &&
 	git tag "rm-not-a-b" &&
 	git merge-tree rm-a-not-b-base rm-a-not-b-base rm-a-not-b >actual &&
-	cat >expected <<EXPECTED &&
-removed in remote
-  base   100644 $(git rev-parse rm-a-not-b-base:ONE) ONE
-  our    100644 $(git rev-parse rm-a-not-b-base:ONE) ONE
-@@ -1 +0,0 @@
--AAA
-EXPECTED
-
 	test_cmp expected actual
 '
 
@@ -202,6 +201,14 @@ test_expect_success 'file remove A, B (same)' '
 '
 
 test_expect_success 'file change A, remove B' '
+	cat >expected <<\EXPECTED &&
+removed in remote
+  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
+  our    100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE
+@@ -1 +0,0 @@
+-BBB
+EXPECTED
+
 	git reset --hard initial &&
 	test_commit "change-a-rm-b-base" "ONE" "AAA" &&
 	test_commit "change-a-rm-b-A" "ONE" "BBB" &&
@@ -211,18 +218,16 @@ test_expect_success 'file change A, remove B' '
 	git tag "change-a-rm-b-B" &&
 	git merge-tree change-a-rm-b-base change-a-rm-b-A change-a-rm-b-B \
 		>actual &&
-	cat >expected <<EXPECTED &&
-removed in remote
-  base   100644 $(git rev-parse change-a-rm-b-base:ONE) ONE
-  our    100644 $(git rev-parse change-a-rm-b-A:ONE   ) ONE
-@@ -1 +0,0 @@
--BBB
-EXPECTED
-
 	test_cmp expected actual
 '
 
 test_expect_success 'file remove A, change B' '
+	cat >expected <<\EXPECTED &&
+removed in local
+  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d ONE
+  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 ONE
+EXPECTED
+
 	git reset --hard initial &&
 	test_commit "rm-a-change-b-base" "ONE" "AAA" &&
 
@@ -233,11 +238,6 @@ test_expect_success 'file remove A, change B' '
 	test_commit "rm-a-change-b-B" "ONE" "BBB" &&
 	git merge-tree rm-a-change-b-base rm-a-change-b-A rm-a-change-b-B \
 		>actual &&
-	cat >expected <<EXPECTED &&
-removed in local
-  base   100644 $(git rev-parse rm-a-change-b-base:ONE) ONE
-  their  100644 $(git rev-parse rm-a-change-b-B:ONE   ) ONE
-EXPECTED
 	test_cmp expected actual
 '
 
@@ -250,17 +250,10 @@ test_expect_success 'tree add A, B (same)' '
 '
 
 test_expect_success 'tree add A, B (different)' '
-	git reset --hard initial &&
-	mkdir sub &&
-	test_commit "add sub/file" "sub/file" "AAA" add-tree-a-b-A &&
-	git reset --hard initial &&
-	mkdir sub &&
-	test_commit "add sub/file" "sub/file" "BBB" add-tree-a-b-B &&
-	git merge-tree initial add-tree-a-b-A add-tree-a-b-B >actual &&
-	cat >expect <<-EOF &&
+	cat >expect <<-\EOF &&
 	added in both
-	  our    100644 $(git rev-parse add-tree-a-b-A:sub/file) sub/file
-	  their  100644 $(git rev-parse add-tree-a-b-B:sub/file) sub/file
+	  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file
+	  their  100644 ba629238ca89489f2b350e196ca445e09d8bb834 sub/file
 	@@ -1 +1,5 @@
 	+<<<<<<< .our
 	 AAA
@@ -268,10 +261,24 @@ test_expect_success 'tree add A, B (different)' '
 	+BBB
 	+>>>>>>> .their
 	EOF
+	git reset --hard initial &&
+	mkdir sub &&
+	test_commit "add sub/file" "sub/file" "AAA" add-tree-a-b-A &&
+	git reset --hard initial &&
+	mkdir sub &&
+	test_commit "add sub/file" "sub/file" "BBB" add-tree-a-b-B &&
+	git merge-tree initial add-tree-a-b-A add-tree-a-b-B >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'tree unchanged A, removed B' '
+	cat >expect <<-\EOF &&
+	removed in remote
+	  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file
+	  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d sub/file
+	@@ -1 +0,0 @@
+	-AAA
+	EOF
 	git reset --hard initial &&
 	mkdir sub &&
 	test_commit "add sub/file" "sub/file" "AAA" tree-remove-b-initial &&
@@ -280,13 +287,6 @@ test_expect_success 'tree unchanged A, removed B' '
 	git commit -m "remove sub/file" &&
 	git tag tree-remove-b-B &&
 	git merge-tree tree-remove-b-initial tree-remove-b-initial tree-remove-b-B >actual &&
-	cat >expect <<-EOF &&
-	removed in remote
-	  base   100644 $(git rev-parse tree-remove-b-initial:sub/file) sub/file
-	  our    100644 $(git rev-parse tree-remove-b-initial:sub/file) sub/file
-	@@ -1 +0,0 @@
-	-AAA
-	EOF
 	test_cmp expect actual
 '
 
@@ -296,14 +296,14 @@ test_expect_success 'turn file to tree' '
 	mkdir initial-file &&
 	test_commit "turn-file-to-tree" "initial-file/ONE" "CCC" &&
 	git merge-tree initial initial turn-file-to-tree >actual &&
-	cat >expect <<-EOF &&
+	cat >expect <<-\EOF &&
 	added in remote
-	  their  100644 $(git rev-parse turn-file-to-tree:initial-file/ONE) initial-file/ONE
+	  their  100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 initial-file/ONE
 	@@ -0,0 +1 @@
 	+CCC
 	removed in remote
-	  base   100644 $(git rev-parse initial:initial-file) initial-file
-	  our    100644 $(git rev-parse initial:initial-file) initial-file
+	  base   100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
+	  our    100644 e79c5e8f964493290a409888d5413a737e8e5dd5 initial-file
 	@@ -1 +0,0 @@
 	-initial
 	EOF
@@ -318,14 +318,14 @@ test_expect_success 'turn tree to file' '
 	rm -fr dir &&
 	test_commit "make-file" "dir" "CCC" &&
 	git merge-tree add-tree add-another-tree make-file >actual &&
-	cat >expect <<-EOF &&
+	cat >expect <<-\EOF &&
 	removed in remote
-	  base   100644 $(git rev-parse add-tree:dir/path) dir/path
-	  our    100644 $(git rev-parse add-tree:dir/path) dir/path
+	  base   100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path
+	  our    100644 43d5a8ed6ef6c00ff775008633f95787d088285d dir/path
 	@@ -1 +0,0 @@
 	-AAA
 	added in remote
-	  their  100644 $(git rev-parse make-file:dir) dir
+	  their  100644 43aa4fdec31eb92e1fdc2f0ce6ea9ddb7c32bcf7 dir
 	@@ -0,0 +1 @@
 	+CCC
 	EOF