mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
Use git ls-files
instead of local files for git rm --cached
`git rm --cached` is often used to delete a file that no longer exists in the working tree but remains in git's index. `git ls-files` will list files that are in the HEAD, which is exactly what we want. Local files not in `HEAD` can't be deleted from git anyway.
This commit is contained in:
parent
0f6c763d9e
commit
c24739d3bd
1 changed files with 2 additions and 2 deletions
|
@ -335,7 +335,7 @@ function __fish_git_possible_commithash
|
|||
end
|
||||
|
||||
function __fish_git_reflog
|
||||
command git reflog --no-decorate ^/dev/null | string replace -r '[0-9a-f]* (.+@\{[0-9]+\}): (.*)$' '$1\t$2'
|
||||
command git reflog --no-decorate ^/dev/null | string replace -r '[0-9a-f]* [(.+@\{[0-9]+\}): (.*)$' '$1\t$2'
|
||||
end
|
||||
|
||||
# general options
|
||||
|
@ -877,8 +877,8 @@ complete -f -c git -n '__fish_git_using_command revert' -a '(__fish_git_commits)
|
|||
|
||||
### rm
|
||||
complete -c git -n '__fish_git_needs_command' -a rm -d 'Remove files from the working tree and from the index'
|
||||
complete -c git -n '__fish_git_using_command rm'
|
||||
complete -c git -n '__fish_git_using_command rm' -l cached -d 'Keep local copies'
|
||||
complete -c git -n '__fish_git_using_command rm; and __fish_contains_opt -s _ cached' -f -a '(git ls-files)'
|
||||
complete -c git -n '__fish_git_using_command rm' -l ignore-unmatch -d 'Exit with a zero status even if no files matched'
|
||||
complete -c git -n '__fish_git_using_command rm' -s r -d 'Allow recursive removal'
|
||||
complete -c git -n '__fish_git_using_command rm' -s q -l quiet -d 'Be quiet'
|
||||
|
|
Loading…
Reference in a new issue