diff options
author | James Lopez <james@jameslopez.es> | 2016-02-24 15:54:36 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-02-24 15:54:36 +0100 |
commit | d377948931fddc27b51993b0400af7385e15a8b4 (patch) | |
tree | e4fef5880dbc21d24bc3d4adf7b121b3f5106689 /lib | |
parent | d74cfe7db312acff527bef9d7894f894efdd3751 (diff) | |
download | gitlab-ce-d377948931fddc27b51993b0400af7385e15a8b4.tar.gz |
fix for projects ending in .wiki
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index e38736fc28b..c7705aeb59a 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -14,6 +14,14 @@ module API # ref - branch name # forced_push - forced_push # + + helpers do + def wiki + @wiki ||= params[:project].end_with?('.wiki') && + !Project.find_with_namespace(params[:project]) + end + end + post "/allowed" do status 200 @@ -30,7 +38,6 @@ module API # Strip out the .wiki from the pathname before finding the # project. This applies the correct project permissions to # the wiki repository as well. - wiki = project_path.end_with?('.wiki') project_path.chomp!('.wiki') if wiki project = Project.find_with_namespace(project_path) |