@@ -72,11 +72,14 @@ test_expect_success 'merge simple rename+criss-cross with no modifications' '
72
72
git ls-files -o >out &&
73
73
test_line_count = 3 out &&
74
74
75
- test $(git rev-parse :2:three) = $(git rev-parse L2:three) &&
76
- test $(git rev-parse :3:three) = $(git rev-parse R2:three) &&
77
-
78
- test $(git rev-parse L2:three) = $(git hash-object three~HEAD) &&
79
- test $(git rev-parse R2:three) = $(git hash-object three~R2^0)
75
+ git rev-parse >expect \
76
+ L2:three R2:three \
77
+ L2:three R2:three &&
78
+ git rev-parse >actual \
79
+ :2:three :3:three &&
80
+ git hash-object >>actual \
81
+ three~HEAD three~R2^0
82
+ test_cmp expect actual
80
83
)
81
84
'
82
85
@@ -145,11 +148,14 @@ test_expect_success 'merge criss-cross + rename merges with basic modification'
145
148
git ls-files -o >out &&
146
149
test_line_count = 3 out &&
147
150
148
- test $(git rev-parse :2:three) = $(git rev-parse L2:three) &&
149
- test $(git rev-parse :3:three) = $(git rev-parse R2:three) &&
150
-
151
- test $(git rev-parse L2:three) = $(git hash-object three~HEAD) &&
152
- test $(git rev-parse R2:three) = $(git hash-object three~R2^0)
151
+ git rev-parse >expect \
152
+ L2:three R2:three \
153
+ L2:three R2:three &&
154
+ git rev-parse >actual \
155
+ :2:three :3:three &&
156
+ git hash-object >>actual \
157
+ three~HEAD three~R2^0
158
+ test_cmp expect actual
153
159
)
154
160
'
155
161
@@ -224,19 +230,23 @@ test_expect_success 'git detects differently handled merges conflict' '
224
230
git ls-files -o >out &&
225
231
test_line_count = 1 out &&
226
232
227
- test $(git rev-parse :2:new_a) = $(git rev-parse D:new_a) &&
228
- test $(git rev-parse :3:new_a) = $(git rev-parse E:new_a) &&
233
+ git rev-parse >expect \
234
+ D:new_a E:new_a &&
235
+ git rev-parse >actual \
236
+ :2:new_a :3:new_a &&
237
+ test_cmp expect actual
229
238
230
- git cat-file -p B:new_a >>merged &&
231
- git cat-file -p C:new_a >>merge-me &&
239
+ git cat-file -p B:new_a >ours &&
240
+ git cat-file -p C:new_a >theirs &&
232
241
>empty &&
233
242
test_must_fail git merge-file \
234
243
-L "Temporary merge branch 2" \
235
244
-L "" \
236
245
-L "Temporary merge branch 1" \
237
- merged empty merge-me &&
238
- sed -e "s/^\([<=>]\)/\1\1\1/" merged >merged-internal &&
239
- test $(git rev-parse :1:new_a) = $(git hash-object merged-internal)
246
+ ours empty theirs &&
247
+ sed -e "s/^\([<=>]\)/\1\1\1/" ours >expect &&
248
+ git cat-file -p :1:new_a >actual &&
249
+ test_cmp expect actual
240
250
)
241
251
'
242
252
@@ -311,8 +321,11 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
311
321
git ls-files -u >out &&
312
322
test_line_count = 2 out &&
313
323
314
- test $(git rev-parse :1:file) = $(git rev-parse master:file) &&
315
- test $(git rev-parse :2:file) = $(git rev-parse B:file)
324
+ git rev-parse >expect \
325
+ master:file B:file &&
326
+ git rev-parse >actual \
327
+ :1:file :2:file &&
328
+ test_cmp expect actual
316
329
)
317
330
'
318
331
@@ -330,8 +343,11 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
330
343
git ls-files -u >out &&
331
344
test_line_count = 2 out &&
332
345
333
- test $(git rev-parse :1:file) = $(git rev-parse master:file) &&
334
- test $(git rev-parse :3:file) = $(git rev-parse B:file)
346
+ git rev-parse >expect \
347
+ master:file B:file &&
348
+ git rev-parse >actual \
349
+ :1:file :3:file &&
350
+ test_cmp expect actual
335
351
)
336
352
'
337
353
@@ -443,8 +459,11 @@ test_expect_success 'merge of D & E1 fails but has appropriate contents' '
443
459
git ls-files -o >out &&
444
460
test_line_count = 1 out &&
445
461
446
- test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
447
- test $(git rev-parse :2:a) = $(git rev-parse B:a)
462
+ git rev-parse >expect \
463
+ A:ignore-me B:a &&
464
+ git rev-parse >actual \
465
+ :0:ignore-me :2:a &&
466
+ test_cmp expect actual
448
467
)
449
468
'
450
469
@@ -463,8 +482,11 @@ test_expect_success 'merge of E1 & D fails but has appropriate contents' '
463
482
git ls-files -o >out &&
464
483
test_line_count = 1 out &&
465
484
466
- test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
467
- test $(git rev-parse :3:a) = $(git rev-parse B:a)
485
+ git rev-parse >expect \
486
+ A:ignore-me B:a &&
487
+ git rev-parse >actual \
488
+ :0:ignore-me :3:a &&
489
+ test_cmp expect actual
468
490
)
469
491
'
470
492
@@ -483,10 +505,11 @@ test_expect_success 'merge of D & E2 fails but has appropriate contents' '
483
505
git ls-files -o >out &&
484
506
test_line_count = 2 out &&
485
507
486
- test $(git rev-parse :2:a) = $(git rev-parse B:a) &&
487
- test $(git rev-parse :3:a/file) = $(git rev-parse E2:a/file) &&
488
- test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
489
- test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
508
+ git rev-parse >expect \
509
+ B:a E2:a/file c:a/file A:ignore-me &&
510
+ git rev-parse >actual \
511
+ :2:a :3:a/file :1:a/file :0:ignore-me &&
512
+ test_cmp expect actual
490
513
491
514
test_path_is_file a~HEAD
492
515
)
@@ -507,10 +530,11 @@ test_expect_success 'merge of E2 & D fails but has appropriate contents' '
507
530
git ls-files -o >out &&
508
531
test_line_count = 2 out &&
509
532
510
- test $(git rev-parse :3:a) = $(git rev-parse B:a) &&
511
- test $(git rev-parse :2:a/file) = $(git rev-parse E2:a/file) &&
512
- test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
513
- test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
533
+ git rev-parse >expect \
534
+ B:a E2:a/file c:a/file A:ignore-me &&
535
+ git rev-parse >actual \
536
+ :3:a :2:a/file :1:a/file :0:ignore-me &&
537
+ test_cmp expect actual
514
538
515
539
test_path_is_file a~D^0
516
540
)
@@ -688,9 +712,15 @@ test_expect_failure 'detect rename/rename/add-source for virtual merge-base' '
688
712
git ls-files -o >out &&
689
713
test_line_count = 1 out &&
690
714
691
- test $(git rev-parse HEAD:b) = $(git rev-parse A:a) &&
692
- test $(git rev-parse HEAD:c) = $(git rev-parse A:a) &&
693
- test "$(cat a)" = "$(printf "1\n2\n3\n4\n5\n6\n7\n8\n")"
715
+ printf "1\n2\n3\n4\n5\n6\n7\n8\n" >correct &&
716
+ git rev-parse >expect \
717
+ A:a A:a \
718
+ correct &&
719
+ git rev-parse >actual \
720
+ :0:b :0:c &&
721
+ git hash-object >>actual \
722
+ a &&
723
+ test_cmp expect actual
694
724
)
695
725
'
696
726
@@ -765,8 +795,11 @@ test_expect_success 'virtual merge base handles rename/rename(1to2)/add-dest' '
765
795
git ls-files -o >out &&
766
796
test_line_count = 1 out &&
767
797
768
- test $(git rev-parse HEAD:a) = $(git rev-parse A:a) &&
769
- test $(git rev-parse HEAD:c) = $(git rev-parse E:c)
798
+ git rev-parse >expect \
799
+ A:a E:c &&
800
+ git rev-parse >actual \
801
+ :0:a :0:c &&
802
+ test_cmp expect actual
770
803
)
771
804
'
772
805
0 commit comments