##// END OF EJS Templates
Merged r14758 (#21071)....
Jean-Philippe Lang -
r14421:a483b19a95f6
parent child
Show More
@@ -200,7 +200,7 class Changeset < ActiveRecord::Base
200 # Finds an issue that can be referenced by the commit message
200 # Finds an issue that can be referenced by the commit message
201 def find_referenced_issue_by_id(id)
201 def find_referenced_issue_by_id(id)
202 return nil if id.blank?
202 return nil if id.blank?
203 issue = Issue.includes(:project).where(:id => id.to_i).first
203 issue = Issue.find_by_id(id.to_i)
204 if Setting.commit_cross_project_ref?
204 if Setting.commit_cross_project_ref?
205 # all issues can be referenced/fixed
205 # all issues can be referenced/fixed
206 elsif issue
206 elsif issue
@@ -165,6 +165,18 class ChangesetTest < ActiveSupport::TestCase
165 assert_equal [1,2,3], c.issue_ids.sort
165 assert_equal [1,2,3], c.issue_ids.sort
166 end
166 end
167
167
168 def test_ref_keywords_with_large_number_should_not_error
169 Setting.commit_ref_keywords = '*'
170 c = Changeset.new(:repository => Project.find(1).repository,
171 :committed_on => Time.now,
172 :comments => 'Out of range #2010021810000121',
173 :revision => '12345')
174 assert_nothing_raised do
175 assert c.save
176 end
177 assert_equal [], c.issue_ids.sort
178 end
179
168 def test_update_keywords_with_changes_should_create_journal
180 def test_update_keywords_with_changes_should_create_journal
169 issue = Issue.generate!(:project_id => 1, :status_id => 1)
181 issue = Issue.generate!(:project_id => 1, :status_id => 1)
170
182
General Comments 0
You need to be logged in to leave comments. Login now