diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 201524c34edac0..0cf625ca01ca35 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -464,6 +464,9 @@ proc _which {what args} { regsub -all ";" $gitguidir "\\;" gitguidir set env(PATH) "$gitguidir;$env(PATH)" set _search_path [split $env(PATH) {;}] + # Skip empty `PATH` elements + set _search_path [lsearch -all -inline -not -exact \ + $_search_path ""] set _search_exe .exe } else { set _search_path [split $env(PATH) :]