From c80cf8c5e1b7d1594fbb2398f0ca19206d3a2d89 Mon Sep 17 00:00:00 2001 From: Jia Sui Date: Wed, 2 Sep 2020 12:28:46 +0800 Subject: [PATCH] Add missing parameters to fix gclean Without `-f` some file will not be cleaned --- forgit.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forgit.plugin.zsh b/forgit.plugin.zsh index f2fcb1c..78ea101 100755 --- a/forgit.plugin.zsh +++ b/forgit.plugin.zsh @@ -142,8 +142,8 @@ forgit::clean() { $FORGIT_CLEAN_FZF_OPTS " # Note: Postfix '/' in directory path should be removed. Otherwise the directory itself will not be removed. - files=$(git clean -xdfn "$@"| sed 's/^Would remove //' | FZF_DEFAULT_OPTS="$opts" fzf |sed 's#/$##') - [[ -n "$files" ]] && echo "$files" | tr '\n' '\0' | xargs -0 -I% git clean -xdf '%' && git status --short && return + files=$(git clean -xdffn "$@"| sed 's/^Would remove //' | FZF_DEFAULT_OPTS="$opts" fzf |sed 's#/$##') + [[ -n "$files" ]] && echo "$files" | tr '\n' '\0' | xargs -0 -I% git clean -xdff '%' && git status --short && return echo 'Nothing to clean.' }