Skip to content

Commit

Permalink
Fixed: Untracked files with spaces in the path do not show a preview …
Browse files Browse the repository at this point in the history
…in 'ga' (#271)
  • Loading branch information
sandr01d committed Jan 11, 2023
1 parent d1a5530 commit 329523b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/git-forgit
Expand Up @@ -154,10 +154,10 @@ _forgit_add() {
sed -e 's/^\\\"//' -e 's/\\\"\$//'"
preview="
file=\$(echo {} | $extract)
if (git status -s -- \$file | grep '^??') &>/dev/null; then # diff with /dev/null for untracked files
git diff --color=always --no-index -- /dev/null \$file | $_forgit_diff_pager | sed '2 s/added:/untracked:/'
if (git status -s -- \\\"\$file\\\" | grep '^??') &>/dev/null; then # diff with /dev/null for untracked files
git diff --color=always --no-index -- /dev/null \\\"\$file\\\" | $_forgit_diff_pager | sed '2 s/added:/untracked:/'
else
git diff --color=always -- \$file | $_forgit_diff_pager
git diff --color=always -- \\\"\$file\\\" | $_forgit_diff_pager
fi"
opts="
$FORGIT_FZF_DEFAULT_OPTS
Expand Down

0 comments on commit 329523b

Please sign in to comment.