Skip to content

Commit

Permalink
Fix gclean preview for directories
Browse files Browse the repository at this point in the history
  • Loading branch information
sandr01d committed Apr 10, 2024
1 parent 5306146 commit a5eaff2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bin/git-forgit
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,17 @@ _forgit_stash_push() {
}

_forgit_clean_preview() {
local file
file=$1
git diff --color=always /dev/null "$file" | _forgit_pager diff
local path
path=$1
if [[ -d "$path" ]]; then
if hash tree &> /dev/null; then
tree "$path"
else
find "$path"
fi
else
git diff --color=always /dev/null "$path" | _forgit_pager diff
fi
}

# git clean selector
Expand Down

0 comments on commit a5eaff2

Please # to comment.