@matheusbsbs / matheus-bagliano / commits / 37e5c8f460
Fork 0

Simplify t3411

Use test_commit() and test_merge(). This way, it is harder to forget to tag, or to call test_tick before committing. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jan 27, 2009 at 23:35 UTC 37e5c8f46042510176a71d73c903c44214e09815
1 file changed +17 -48
t/t3411-rebase-preserve-around-merges.sh
+17 -48
@@ -21,27 +21,13 @@ set_fake_editor
21 # -- C1 --
22
23 test_expect_success 'setup' '
24 - touch a &&
25 - touch b &&
26 - git add a &&
27 - git commit -m A1 &&
28 - git tag A1
29 - git add b &&
30 - git commit -m B1 &&
31 - git tag B1 &&
32 - git checkout -b branch &&
33 - touch c &&
34 - git add c &&
35 - git commit -m C1 &&
36 - git checkout master &&
37 - touch d &&
38 - git add d &&
39 - git commit -m D1 &&
40 - git merge branch &&
41 - touch f &&
42 - git add f &&
43 - git commit -m F1 &&
44 - git tag F1
24 + test_commit A1 &&
25 + test_commit B1 &&
26 + test_commit C1 &&
27 + git reset --hard B1 &&
28 + test_commit D1 &&
29 + test_merge E1 C1 &&
30 + test_commit F1
31 '
32
33 # Should result in:
@@ -52,7 +38,7 @@ test_expect_success 'setup' '
38 #
39 test_expect_success 'squash F1 into D1' '
40 FAKE_LINES="1 squash 3 2" git rebase -i -p B1 &&
55 - test "$(git rev-parse HEAD^2)" = "$(git rev-parse branch)" &&
41 + test "$(git rev-parse HEAD^2)" = "$(git rev-parse C1)" &&
42 test "$(git rev-parse HEAD~2)" = "$(git rev-parse B1)" &&
43 git tag E2
44 '
@@ -70,32 +56,15 @@ test_expect_success 'squash F1 into D1' '
56 # And rebase G1..M1 onto E2
57
58 test_expect_success 'rebase two levels of merge' '
73 - git checkout -b branch2 A1 &&
74 - touch g &&
75 - git add g &&
76 - git commit -m G1 &&
77 - git checkout -b branch3 &&
78 - touch h
79 - git add h &&
80 - git commit -m H1 &&
81 - git checkout -b branch4 &&
82 - touch i &&
83 - git add i &&
84 - git commit -m I1 &&
85 - git tag I1 &&
86 - git checkout branch3 &&
87 - touch j &&
88 - git add j &&
89 - git commit -m J1 &&
90 - git merge I1 --no-commit &&
91 - git commit -m K1 &&
92 - git tag K1 &&
93 - git checkout branch2 &&
94 - touch l &&
95 - git add l &&
96 - git commit -m L1 &&
97 - git merge K1 --no-commit &&
98 - git commit -m M1 &&
59 + test_commit G1 &&
60 + test_commit H1 &&
61 + test_commit I1 &&
62 + git checkout -b branch3 H1 &&
63 + test_commit J1 &&
64 + test_merge K1 I1 &&
65 + git checkout -b branch2 G1 &&
66 + test_commit L1 &&
67 + test_merge M1 K1 &&
68 GIT_EDITOR=: git rebase -i -p E2 &&
69 test "$(git rev-parse HEAD~3)" = "$(git rev-parse E2)" &&
70 test "$(git rev-parse HEAD~2)" = "$(git rev-parse HEAD^2^2~2)" &&