Feate: allow passing arguments to git checkout file (#451)

This commit is contained in:
sandr01d 2025-07-13 15:41:48 +02:00 committed by GitHub
parent fe350db899
commit b71e54c4aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -837,7 +837,7 @@ _forgit_git_checkout_file() {
_forgit_checkout_file() {
_forgit_inside_work_tree || return 1
local files opts
[[ $# -ne 0 ]] && { _forgit_git_checkout_file -- "$@"; return $?; }
_forgit_contains_non_flags "$@" && { _forgit_git_checkout_file -- "$@"; return $?; }
opts="
$FORGIT_FZF_DEFAULT_OPTS
-m -0
@ -849,7 +849,7 @@ _forgit_checkout_file() {
files+=("$file")
done < <(_forgit_list_files --modified |
FZF_DEFAULT_OPTS="$opts" fzf)
[[ "${#files[@]}" -gt 0 ]] && _forgit_git_checkout_file "${files[@]}"
[[ "${#files[@]}" -gt 0 ]] && _forgit_git_checkout_file "$@" "${files[@]}"
}
_forgit_git_checkout_branch() {