mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 13:46:11 +10:00
26 lines
532 B
Ruby
26 lines
532 B
Ruby
class Projects::GitHooksController < Projects::ApplicationController
|
|
# Authorize
|
|
before_filter :authorize_admin_project!
|
|
|
|
respond_to :html
|
|
|
|
layout "project_settings"
|
|
|
|
def index
|
|
project.create_git_hook unless project.git_hook
|
|
|
|
@pre_receive_hook = project.git_hook
|
|
end
|
|
|
|
def update
|
|
@pre_receive_hook = project.git_hook
|
|
@pre_receive_hook.update_attributes(params[:git_hook])
|
|
|
|
if @pre_receive_hook.valid?
|
|
redirect_to project_git_hooks_path(@project)
|
|
else
|
|
render :index
|
|
end
|
|
end
|
|
end
|