mirror of
https://github.com/git/git.git
synced 2026-08-09 01:21:47 +00:00
completion: complete 'git history split' pathspecs
Arguments following the required revision of "git history split" are pathspecs. Complete them from tracked paths, including after an explicit "--". Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e500dcc192
commit
c956ef3585
@@ -2197,6 +2197,12 @@ _git_history ()
|
||||
__git_complete_refs
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
split)
|
||||
__git_complete_index_file "--cached"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_git_init ()
|
||||
|
||||
@@ -3143,6 +3143,19 @@ test_expect_success 'git history revisions' '
|
||||
test_completion "git history reword main m" ""
|
||||
'
|
||||
|
||||
test_expect_success 'git history split pathspecs' '
|
||||
test_completion "git history split main -- --update-refs=h" "" &&
|
||||
test_completion "git history split main -- --update-refs h" "" &&
|
||||
test_completion "git history split --dry-run main file" <<-\EOF &&
|
||||
file1Z
|
||||
file2Z
|
||||
EOF
|
||||
test_completion "git history split main -- file" <<-\EOF
|
||||
file1Z
|
||||
file2Z
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'git reflog show' '
|
||||
test_when_finished "git checkout - && git branch -d shown" &&
|
||||
git checkout -b shown &&
|
||||
|
||||
Reference in New Issue
Block a user