Skip Menu |

This queue is for tickets about the Git-Repository CPAN distribution.

Report information
The Basics
Id: 80117
Status: resolved
Priority: 0/
Queue: Git-Repository

People
Owner: Nobody in particular
Requestors: DOY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.27



Subject: fails with a directory named 'git' in the path
I keep my local git subcommands in ~/.bin/git, but Git::Repository's tests detect this as being a potential git binary when searching through $PATH (in t/05-try_git.t:54 and t/20-simple.t:228), and try to run it. The tests on those lines should use something like -e && !-d, or maybe even -f && -x.
On Wed Oct 10 16:13:26 2012, DOY wrote: Show quoted text
> I keep my local git subcommands in ~/.bin/git, but Git::Repository's > tests detect this as being a potential git binary when searching
through Show quoted text
> $PATH (in t/05-try_git.t:54 and t/20-simple.t:228), and try to run it. > The tests on those lines should use something like -e && !-d, or maybe > even -f && -x.
And the most annoying bit is that the code in Git::Repository::Command that does the same thing does the check with grep { -e && !-d } (in lib/Git/Repository/Command.pm:67)... Using -f would prevent the detection of symlinks. The right test would probably be -x && !-d, to also prevent against people having a non-executable file named git in their PATH. Looking further in the code, I find that the code in _is_git does the -x later, to put an undef in its cache and avoid finding the same file over and over again. On the other hand, quick tests in bash showed that non-executable files are ignored when searching through $PATH. Anyway, the tests and the code now fixed in version 1.27, on its way to CPAN. Thanks! -- BooK