kelleyma49 / PSFzf

A PowerShell wrapper around the fuzzy finder fzf
MIT License
752 stars 35 forks source link

Fix "git" preview in PsFzfTabExpansion-Preview.ps1 #213

Closed Konstantin-Glukhov closed 1 year ago

Konstantin-Glukhov commented 1 year ago

Do not go into "git" preview if git command is not available or the current preview item is not .git folder

kelleyma49 commented 1 year ago

@Konstantin-Glukhov , I believe I have a better fix in #224. Let me know what you think.

Konstantin-Glukhov commented 1 year ago

I don't think your change is better. Checking for existence of .git folder is essential, because there is not reason to run git command outside of git folder, it will produce the following output:

fatal: not a git repository (or any parent up to mount point /path)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).