summaryrefslogtreecommitdiffstats
path: root/app/models/changeset.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/changeset.rb')
-rw-r--r--app/models/changeset.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index e90901ef5..d017ad03b 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -187,11 +187,13 @@ class Changeset < ActiveRecord::Base
private
# Finds an issue that can be referenced by the commit message
- # i.e. an issue that belong to the repository project, a subproject or a parent project
def find_referenced_issue_by_id(id)
return nil if id.blank?
issue = Issue.find_by_id(id.to_i, :include => :project)
- if issue
+ if Setting.commit_cross_project_ref?
+ # all issues can be referenced/fixed
+ elsif issue
+ # issue that belong to the repository project, a subproject or a parent project only
unless issue.project &&
(project == issue.project || project.is_ancestor_of?(issue.project) ||
project.is_descendant_of?(issue.project))