diff options
author | Steve Norman <steve.norman@thomsonreuters.com> | 2015-05-05 15:13:11 +0000 |
---|---|---|
committer | Steve Norman <steve.norman@thomsonreuters.com> | 2016-01-04 13:48:00 +0000 |
commit | 79ec7f289748ca5812d51c3a61e3a2f9c2464fda (patch) | |
tree | e882f0feb35cc9e8d2247b53f4bfad88b69ca82a /app/models/project.rb | |
parent | 57074d606b20516921ff2297e2f94262b58e3d3e (diff) | |
download | gitlab-ce-79ec7f289748ca5812d51c3a61e3a2f9c2464fda.tar.gz |
Added system hooks messages for renaming and transferring a project
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 017471995ec..eadc42d1da5 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -81,6 +81,7 @@ class Project < ActiveRecord::Base acts_as_taggable_on :tags attr_accessor :new_default_branch + attr_accessor :old_path_with_namespace # Relations belongs_to :creator, foreign_key: 'creator_id', class_name: 'User' @@ -701,6 +702,11 @@ class Project < ActiveRecord::Base gitlab_shell.mv_repository("#{old_path_with_namespace}.wiki", "#{new_path_with_namespace}.wiki") send_move_instructions(old_path_with_namespace) reset_events_cache + + @old_path_with_namespace = old_path_with_namespace + + SystemHooksService.new.execute_hooks_for(self, :rename) + @repository = nil rescue # Returning false does not rollback after_* transaction but gives |