From 626661f855551c156601f0d1e4f7ab1c4be01d2e Mon Sep 17 00:00:00 2001 From: Christopher Apple Date: Thu, 7 Nov 2019 08:36:45 -0700 Subject: [PATCH] Fixed issue with mutliple inputs to git commands using ctrl+r Former-commit-id: 94a2c9c059140bb34558b64c1800dd636a6914df --- forgit.plugin.fish | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/forgit.plugin.fish b/forgit.plugin.fish index 9bbc2aa..924308d 100755 --- a/forgit.plugin.fish +++ b/forgit.plugin.fish @@ -91,7 +91,7 @@ function forgit::add sed 's/.* -> //') # for rename case if test -n "$files" - echo "$files" |xargs -I{} git add {} && git status --short && return + echo $files | tr ' ' '\n' |xargs -I{} git add {} && git status --short && return end echo 'Nothing to add.' end @@ -107,8 +107,7 @@ function forgit::reset::head " set files (git diff --cached --name-only --relative | env FZF_DEFAULT_OPTS="$opts" fzf) if test -n "$files" - echo herer - echo "$files" |xargs -I{} git reset -q HEAD {} && git status --short && return + echo $files | tr ' ' '\n' |xargs -I{} git reset -q HEAD {} && git status --short && return end echo 'Nothing to unstage.' end @@ -126,7 +125,7 @@ function forgit::restore set git_rev_parse (git rev-parse --show-toplevel) set files (git ls-files --modified "$git_rev_parse" | env FZF_DEFAULT_OPTS="$opts" fzf) if test -n "$files" - echo "$files" |xargs -I{} git checkout {} && git status --short && return + echo $files | tr ' ' '\n' |xargs -I{} git checkout {} && git status --short && return end echo 'Nothing to restore.' end @@ -156,7 +155,7 @@ function forgit::clean set files (git clean -xdfn $argv| awk '{print $3}'| env FZF_DEFAULT_OPTS="$opts" fzf |sed 's#/$##') if test -n "$files" - echo "$files" |xargs -I% git clean -xdf % && return + echo $files | tr ' ' '\n'|xargs -I{} git clean -xdf {} && return end echo 'Nothing to clean.' end