зеркало из https://github.com/microsoft/git.git
Merge branch 'bg/rebase-off-of-previous-branch'
* bg/rebase-off-of-previous-branch: rebase: allow "-" short-hand for the previous branch
This commit is contained in:
Коммит
97345145ff
|
@ -453,6 +453,10 @@ then
|
||||||
test "$fork_point" = auto && fork_point=t
|
test "$fork_point" = auto && fork_point=t
|
||||||
;;
|
;;
|
||||||
*) upstream_name="$1"
|
*) upstream_name="$1"
|
||||||
|
if test "$upstream_name" = "-"
|
||||||
|
then
|
||||||
|
upstream_name="@{-1}"
|
||||||
|
fi
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -88,6 +88,23 @@ test_expect_success 'rebase from ambiguous branch name' '
|
||||||
git rebase master
|
git rebase master
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'rebase off of the previous branch using "-"' '
|
||||||
|
git checkout master &&
|
||||||
|
git checkout HEAD^ &&
|
||||||
|
git rebase @{-1} >expect.messages &&
|
||||||
|
git merge-base master HEAD >expect.forkpoint &&
|
||||||
|
|
||||||
|
git checkout master &&
|
||||||
|
git checkout HEAD^ &&
|
||||||
|
git rebase - >actual.messages &&
|
||||||
|
git merge-base master HEAD >actual.forkpoint &&
|
||||||
|
|
||||||
|
test_cmp expect.forkpoint actual.forkpoint &&
|
||||||
|
# the next one is dubious---we may want to say "-",
|
||||||
|
# instead of @{-1}, in the message
|
||||||
|
test_i18ncmp expect.messages actual.messages
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'rebase a single mode change' '
|
test_expect_success 'rebase a single mode change' '
|
||||||
git checkout master &&
|
git checkout master &&
|
||||||
git branch -D topic &&
|
git branch -D topic &&
|
||||||
|
|
Загрузка…
Ссылка в новой задаче