From b71e54c4aa7123620a61fbbb1206ecd2134039fb Mon Sep 17 00:00:00 2001 From: sandr01d <88739791+sandr01d@users.noreply.github.com> Date: Sun, 13 Jul 2025 15:41:48 +0200 Subject: [PATCH] Feate: allow passing arguments to git checkout file (#451) --- bin/git-forgit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/git-forgit b/bin/git-forgit index 93e2b54..365dd9c 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -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() {