aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/git.fish
diff options
context:
space:
mode:
authorGravatar Jan Ernsting <jan.ernsting@gmail.com>2015-09-04 19:54:45 +0200
committerGravatar Jan Ernsting <jan.ernsting@gmail.com>2015-09-07 11:05:47 +0200
commit787c1304c6026a40f108b67fd8ffa9eb540a4024 (patch)
treee7982362f64513af155e5cfd547a424681561d6d /share/completions/git.fish
parentd92c08c9bb723577653ebe6fc3282deb232be120 (diff)
Add file completion for git-reset
Staged files are now offered for completion
Diffstat (limited to 'share/completions/git.fish')
-rw-r--r--share/completions/git.fish5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/completions/git.fish b/share/completions/git.fish
index bc939767..b385b5f7 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -22,6 +22,10 @@ function __fish_git_modified_files
command git ls-files -m --exclude-standard ^/dev/null
end
+function __fish_git_staged_files
+ command git diff --staged --name-only ^/dev/null
+end
+
function __fish_git_add_files
command git ls-files -mo --exclude-standard ^/dev/null
end
@@ -357,6 +361,7 @@ complete -f -c git -n '__fish_git_using_command rebase' -l no-ff -d 'No fast-for
complete -c git -n '__fish_git_needs_command' -a reset -d 'Reset current HEAD to the specified state'
complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset files in working directory'
complete -c git -n '__fish_git_using_command reset' -a '(__fish_git_branches)'
+complete -f -c git -n '__fish_git_using_command reset' -a '(__fish_git_staged_files)' -d 'File'
# TODO options
### revert