Adds a test for the case when only one parameter is passed to '-m'
(move/rename) option.

For example - if 'git branch -m bbb' is run, it should rename the
currently checked out branch to bbb. There was no test for this
particular case with only one parameter for -m option. However,
there's one similar test case for -M option.

Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
 t/t3200-branch.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index fe62e7c775da6..7504f14bc52f8 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -100,6 +100,14 @@ test_expect_success 'git branch -m n/n n should work' '
        git reflog exists refs/heads/n
 '
 
+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 branch -m bbb &&
+       git reflog exists refs/heads/bbb
+'
+
 test_expect_success 'git branch -m o/o o should fail when o/p exists' '
        git branch o/o &&
        git branch o/p &&

--
https://github.com/git/git/pull/371

Reply via email to