diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6f1ba96763..d313780d8b 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2197,6 +2197,12 @@ _git_history () __git_complete_refs return fi + + case "$subcommand" in + split) + __git_complete_index_file "--cached" + ;; + esac } _git_init () diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index ea86ecc08f..391cc849a8 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -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 &&