Skip Menu |

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

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

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

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



Subject: _is_git incorrectly tries to execute directories
Git::Repository will fail whenever there is an entry of the PATH that contains a directory named "git". It should do a "-f" test instead of a "-e" test.
On Thu Nov 03 17:15:00 2011, DRUOSO wrote: Show quoted text
> Git::Repository will fail whenever there is an entry of the PATH that > contains a directory named "git". It should do a "-f" test instead of a > "-e" test.
But then, what about symlinks? I guess the right answer is probably -e && !-d. Thanks for the report. -- BooK
Subject: Re: [rt.cpan.org #72154] _is_git incorrectly tries to execute directories
Date: Sun, 04 Dec 2011 11:44:37 -0500
To: bug-Git-Repository [...] rt.cpan.org
From: "daniel [...] ruoso.com" <daniel [...] ruoso.com>
I might be wrong at this, but i think -f uses "stat" instead of "lstat", which will not follow symlinks. If that is not the case, then you can always use the explicit "stat" command instead of the operator. Daniel -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. Philippe 'BooK' Bruhat via RT <bug-Git-Repository@rt.cpan.org> escreveu: <URL: https://rt.cpan.org/Ticket/Display.html?id=72154 > On Thu Nov 03 17:15:00 2011, DRUOSO wrote: Show quoted text
> Git::Repository will fail whenever there is an entry of the PATH that > contains a directory named "git". It should do a "-f" test instead of a > "-e" test.
But then, what about symlinks? I guess the right answer is probably -e && !-d. Thanks for the report. -- BooK
On Sun Dec 04 11:45:02 2011, daniel@ruoso.com wrote: Show quoted text
> I might be wrong at this, but i think -f uses "stat" instead of > "lstat", which will not follow symlinks. If that is not the case, then > you can always use the explicit "stat" command instead of the > operator. >
It's true that a symlink pointing to a directory will also cause problems. Anyway, I've written tests to try various cases of symlinks, and using -e && !-d was enough to make the tests pass. Until the next version (1.24) is released, you can check the github repository, or simply apply a patch to the effect of: - ($git) = grep {-e} + ($git) = grep { -e && !-d } to lib/Git/Repository/Command.pm. Please let me know if that fixes your issue, and if it doesn't, please describe a test case that makes this fail. Thanks, -- BooK