Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

always allow non .git repo requests

  • Loading branch information...
commit 98704ae33c8b7cbd9636a710342fc89f89e01f2f 1 parent e668306
@mojombo authored
Showing with 11 additions and 1 deletion.
  1. +1 −1  egitd.conf
  2. +10 −0 elibs/upload_pack.erl
View
2  egitd.conf
@@ -1,3 +1,3 @@
-volcano (.+)/(.+)\.git "/Users/tom/dev/sandbox/git/" ++ conf:hexmod8(Match1) ++ "/" ++ conf:md5_namespace3(Match1) ++ "/" ++ Match1 ++ "/" ++ Match2 ++ ".git".
+volcano (.+)/(.+) "/Users/tom/dev/sandbox/git/" ++ conf:hexmod8(Match1) ++ "/" ++ conf:md5_namespace3(Match1) ++ "/" ++ Match1 ++ "/" ++ Match2.
github.com ([^/]*) "/data/git/repositories/" ++ Match1.
gist.github.com (.*)\.git "/data/git/gists/" ++ conf:namespace3(Match1) ++ "/" ++ Match1 ++ ".git".
View
10 elibs/upload_pack.erl
@@ -43,6 +43,16 @@ repo_existence(Sock, Host, Path, FullPath) ->
true ->
export_ok(Sock, Host, Path, FullPath);
false ->
+ repo_existence_ext(Sock, Host, Path, FullPath)
+ end.
+
+% The repo may always be specified without .git on the end
+repo_existence_ext(Sock, Host, Path, FullPath) ->
+ FullPathExt = FullPath ++ ".git",
+ case file_exists(FullPathExt) of
+ true ->
+ export_ok(Sock, Host, Path, FullPathExt);
+ false ->
error_logger:info_msg("no such repo: ~p~n", [FullPath]),
gen_tcp:send(Sock, "003b\n*********'\n\nNo matching repositories found.\n\n*********"),
ok = gen_tcp:close(Sock)
Please sign in to comment.
Something went wrong with that request. Please try again.