Fixed styles, ProjectHook specs etc
This commit is contained in:
parent
c6298678f5
commit
e16cebac3e
22 changed files with 111 additions and 76 deletions
|
@ -98,6 +98,8 @@ class Commit
|
|||
end
|
||||
|
||||
def initialize(raw_commit, head = nil)
|
||||
raise "Nil as raw commit passed" unless raw_commit
|
||||
|
||||
@commit = raw_commit
|
||||
@head = head
|
||||
end
|
||||
|
@ -136,7 +138,11 @@ class Commit
|
|||
end
|
||||
|
||||
def prev_commit
|
||||
parents.try :first
|
||||
@prev_commit ||= if parents.present?
|
||||
Commit.new(parents.first)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def prev_commit_id
|
||||
|
|
|
@ -361,8 +361,8 @@ class Project < ActiveRecord::Base
|
|||
|
||||
# Discover the default branch, but only if it hasn't already been set to
|
||||
# something else
|
||||
if default_branch.nil?
|
||||
update_attributes(default_branch: discover_default_branch)
|
||||
if repository && default_branch.nil?
|
||||
update_attributes(default_branch: self.repository.discover_default_branch)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue