t3401: use test_commit in setup

Simplify t3401 by using test_commit in the setup. This lets us refer to commits using their tags and there is no longer a need to create the branch my-topic-branch-merge. Also, the branch master-merge points to the same commit as master (even before this change), so that branch does not need to be created either. While at it, replace "test ! -d" by "test_path_is_missing". Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Martin von Zweigbergk committed Dec 10, 2011 at 00:17 UTC 13c907c4fe9b0d96a68c04f7d64f66873e0db8b7
1 file changed +10 -25
t/t3401-rebase-partial.sh
+10 -25
@@ -12,32 +12,17 @@ local branch.
12 . ./test-lib.sh
13
14 test_expect_success 'prepare repository with topic branch' '
15 - echo First > A &&
16 - git update-index --add A &&
17 - git commit -m "Add A." &&
18 -
15 + test_commit A &&
16 git checkout -b my-topic-branch &&
20 -
21 - echo Second > B &&
22 - git update-index --add B &&
23 - git commit -m "Add B." &&
24 -
25 - echo AnotherSecond > C &&
26 - git update-index --add C &&
27 - git commit -m "Add C." &&
28 -
17 + test_commit B &&
18 + test_commit C &&
19 git checkout -f master &&
30 -
31 - echo Third >> A &&
32 - git update-index A &&
33 - git commit -m "Modify A."
20 + test_commit A2 A.t
21 '
22
23 test_expect_success 'pick top patch from topic branch into master' '
37 - git cherry-pick my-topic-branch^0 &&
38 - git checkout -f my-topic-branch &&
39 - git branch master-merge master &&
40 - git branch my-topic-branch-merge my-topic-branch
24 + git cherry-pick C &&
25 + git checkout -f my-topic-branch
26 '
27
28 test_debug '
@@ -48,13 +33,13 @@ test_debug '
33
34 test_expect_success 'rebase topic branch against new master and check git am did not get halted' '
35 git rebase master &&
51 - test ! -d .git/rebase-apply
36 + test_path_is_missing .git/rebase-apply
37 '
38
39 test_expect_success 'rebase --merge topic branch that was partially merged upstream' '
55 - git checkout -f my-topic-branch-merge &&
56 - git rebase --merge master-merge &&
57 - test ! -d .git/rebase-merge
40 + git reset --hard C &&
41 + git rebase --merge master &&
42 + test_path_is_missing .git/rebase-merge
43 '
44
45 test_done