File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 534
534
535
535
if test " $fork_point " = t
536
536
then
537
- new_upstream=$( git merge-base --fork-point " $upstream_name " " $switch_to " )
537
+ new_upstream=$( git merge-base --fork-point " $upstream_name " \
538
+ " ${switch_to:- HEAD} " )
538
539
if test -n " $new_upstream "
539
540
then
540
541
upstream=$new_upstream
Original file line number Diff line number Diff line change @@ -135,11 +135,19 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
135
135
'
136
136
137
137
test_expect_success ' default to common base in @{upstream}s reflog if no upstream arg' '
138
+ git checkout -b default-base master &&
138
139
git checkout -b default topic &&
139
140
git config branch.default.remote . &&
140
- git config branch.default.merge refs/heads/master &&
141
+ git config branch.default.merge refs/heads/default-base &&
141
142
git rebase &&
142
- git rev-parse --verify master >expect &&
143
+ git rev-parse --verify default-base >expect &&
144
+ git rev-parse default~1 >actual &&
145
+ test_cmp expect actual &&
146
+ git checkout default-base &&
147
+ git reset --hard HEAD^ &&
148
+ git checkout default &&
149
+ git rebase &&
150
+ git rev-parse --verify default-base >expect &&
143
151
git rev-parse default~1 >actual &&
144
152
test_cmp expect actual
145
153
'
You can’t perform that action at this time.
0 commit comments