Skip to content

Commit 13c907c

Browse files
Martin von Zweigbergkgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f73e5ee commit 13c907c

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

t/t3401-rebase-partial.sh

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,17 @@ local branch.
1212
. ./test-lib.sh
1313

1414
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 &&
1916
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 &&
2919
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
3421
'
3522

3623
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
4126
'
4227

4328
test_debug '
@@ -48,13 +33,13 @@ test_debug '
4833

4934
test_expect_success 'rebase topic branch against new master and check git am did not get halted' '
5035
git rebase master &&
51-
test ! -d .git/rebase-apply
36+
test_path_is_missing .git/rebase-apply
5237
'
5338

5439
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
5843
'
5944

6045
test_done

0 commit comments

Comments
 (0)