該錯誤消息來自 「gitolite-shell.parse_soc()
」
sub parse_soc {
my $soc = $ENV{SSH_ORIGINAL_COMMAND};
$soc ||= 'info';
my $git_commands = "git-upload-pack|git-receive-pack|git-upload-archive";
if ($soc =~ m(^($git_commands) '/?(.*?)(?:\.git(\d)?)?'$)) {
my ($verb, $repo, $trace_level) = ($1, $2, $3);
$ENV{D} = $trace_level if $trace_level;
_die "invalid repo name: '$repo'" if $repo !~ $REPONAME_PATT;
trace(2, "git command", $soc);
return ($verb, $repo);
}
隨着REPONAME_PATT
之中:
$REPONAME_PATT = qr(^\@?[0-9a-zA-Z][-0-9a-zA-Z._\@/+]*$);
一個gitolite地址不應包含任何路徑,像這樣:
[email protected]:22/repo
而不是[email protected]:22/~git/repositories/repo.git
,這個問題是described here:
Consider [email protected]:repositories/reponame.git
.
The clone operation will work -- you're using the full Unix path, (assuming default $REPO_BASE
setting), and so the shell finds the repo where you said it would be.
However, when you push, gitolite's update hook kicks in, and fails to run because some of the environment variables it is expecting are not present.
可能的重複http://stackoverflow.com/questions/11240797/git-commit-error-repository-invalid? – 2013-03-13 21:37:03
沒有,= \,我已經看到了這一個...錯誤是diferent,反正謝謝 – 2013-03-14 17:07:19