]> git.ipfire.org Git - thirdparty/git.git/commit - t/t9902-completion.sh
completion: add tests showing subpar switch/checkout --orphan logic
authorJacob Keller <jacob.keller@gmail.com>
Thu, 28 May 2020 18:10:39 +0000 (11:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 May 2020 19:53:24 +0000 (12:53 -0700)
commitc81ca56bca2d4b9b2606211106ca4ae0fdded834
treefc4e236b53acf01beef76160c9ee1eae5bc25def
parent7f59d604292774a2c5c79a644419a9aa6c720365
completion: add tests showing subpar switch/checkout --orphan logic

Similar to -c/-C, --orphan takes an argument which is the branch name to
use. We ought to complete this branch name using similar rules as to how
we complete new branch names for -c/-C and -b/-B. Namely, limit the
total number of options provided by completing to the local branches.

Additionally, git switch --orphan does not take any start point and will
always create using the empty-tree. Thus, after the branch name is
completed, git switch --orphan should not complete any references.

Add test cases showing the expected behavior of --orphan, for both the
argument and starting point.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9902-completion.sh