我有一个小 perl 脚本,它试图从 git 存储库中提取,然后从 git log 中获取一些东西:
use Git::Repository;
my $repo = Git::Repository->new(
git_dir => $git_path,
);
$repo->run('pull') || die $!;
my @commits = $repo->run(log);
...
对于身份验证,我有一个.netrc
-file,其中包含我的凭据/home/bla
。当脚本从 shell 运行时,这非常有效。现在我尝试将此脚本用于 Web 应用程序:
my $evil_commits = `./list_commits.pl`;
当我这样做时,它会产生以下错误消息:
[Thu Sep 19 12:50:49 2013] [error] [client <>] fatal: Could not read password: No such device or address at ./list_commits.pl line 45
我已经尝试$ENV{HOME}
在 CGI 脚本中进行设置,但这无济于事。关于我在这里缺少什么的任何建议?