Permalink
Browse files

always allow non .git repo requests

  • Loading branch information...
mojombo committed Jul 8, 2008
1 parent e668306 commit 98704ae33c8b7cbd9636a710342fc89f89e01f2f
Showing with 11 additions and 1 deletion.
  1. +1 −1 egitd.conf
  2. +10 −0 elibs/upload_pack.erl
View
@@ -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
@@ -42,6 +42,16 @@ repo_existence(Sock, Host, Path, FullPath) ->
case file_exists(FullPath) of
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*********"),

0 comments on commit 98704ae

Please sign in to comment.