Merge branch 'sd/t3200-branch-m-test' into maint

New test.

* sd/t3200-branch-m-test:
  t3200: add test for single parameter passed to -m option
This commit is contained in:
Junio C Hamano 2017-06-24 15:29:34 -07:00
Родитель 8d7a6b6c85 bb8efa1772
Коммит 77bcac3e72
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -100,6 +100,23 @@ test_expect_success 'git branch -m n/n n should work' '
git reflog exists refs/heads/n
'
# The topmost entry in reflog for branch bbb is about branch creation.
# Hence, we compare bbb@{1} (instead of bbb@{0}) with aaa@{0}.
test_expect_success 'git branch -m bbb should rename checked out branch' '
test_when_finished git branch -D bbb &&
test_when_finished git checkout master &&
git checkout -b aaa &&
git commit --allow-empty -m "a new commit" &&
git rev-parse aaa@{0} >expect &&
git branch -m bbb &&
git rev-parse bbb@{1} >actual &&
test_cmp expect actual &&
git symbolic-ref HEAD >actual &&
echo refs/heads/bbb >expect &&
test_cmp expect actual
'
test_expect_success 'git branch -m o/o o should fail when o/p exists' '
git branch o/o &&
git branch o/p &&