From 8502ae2cc56a7e406027f418131c79af0f599bcf Mon Sep 17 00:00:00 2001 From: ZenLian Date: Tue, 31 Jan 2023 00:43:17 +0800 Subject: [PATCH] fix: glo can not match files (#249) Fixed "glo -- " behavior to show specified files only instead of showing all changed files. --- bin/git-forgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-forgit b/bin/git-forgit index edd4165..3fdc870 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -74,7 +74,7 @@ _forgit_is_file_tracked="(git ls-files {} --error-unmatch) &> /dev/null" _forgit_log() { _forgit_inside_work_tree || return 1 local opts graph files log_format preview_cmd enter_cmd - files=$(sed -nE 's/.* -- (.*)/\1/p' <<< "$*") # extract files parameters for `git show` command + files=$(sed -nE 's/.*-- (.*)/\1/p' <<< "$*") # extract files parameters for `git show` command preview_cmd="echo {} | $_forgit_extract_sha | xargs -I% git show --color=always -U$_forgit_preview_context % -- $files | $_forgit_show_pager" enter_cmd="echo {} | $_forgit_extract_sha | xargs -I% ${FORGIT} diff %^! $files" opts="