exclude git directories from git_binary function #137

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

catz commented Aug 20, 2012

hi all,

I've got an error with git_binary method with following PATH

/Users/gitlab/.rvm/gems/ruby-1.9.3-p194/bin:/Users/gitlab/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/gitlab/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/gitlab/.rvm/bin:/Users/SoftDromMacmini2/nvm/v0.6.15/bin:/opt/local/bin:/opt/local/sbin:/usr/local:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/PostgreSQL/8.3/bin:/Library/Ruby/Gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/SoftDromMacmini2/.rvm/bin:/Users/gitlab/.rvm/bin

Interesting moment here is that git_binary splits path by colons and add 'git' string. After that final result will be /usr/local/git - but it's directory. On MacOS this leads to Errno::EACCES: Permission denied – posix_spawnp error.

For example try on any directory
bundle exec ruby -e "require 'posix/spawn'; p POSIX::Spawn::Child.new('/usr')"

As a result we should exclude directories from path search.

Collaborator

bkeepers commented Feb 3, 2014

Grit is no longer maintained. See #183 and check out libgit2/rugged.

@bkeepers bkeepers closed this Feb 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment