Commit c0751b8c authored by James Lopez's avatar James Lopez

trying fixes for old commits git hooks problem

parent d69d4381
......@@ -202,8 +202,10 @@ module Gitlab
return build_status_object(true)
end
blank_oldrev = Gitlab::Git.blank_ref?(oldrev)
# if oldrev is blank, the branch was just created
oldrev = project.default_branch if Gitlab::Git.blank_ref?(oldrev)
oldrev = project.default_branch if blank_oldrev
commits =
if oldrev
......@@ -213,7 +215,7 @@ module Gitlab
end
commits.each do |commit|
next if commit_from_annex_sync?(commit.safe_message)
next if commit_from_annex_sync?(commit.safe_message) || (blank_oldrev && old_commit?(commit))
if status_object = check_commit(commit, git_hook)
return status_object
......@@ -373,5 +375,9 @@ module Gitlab
# Commit message starting with <git-annex in > so avoid git hooks on this
commit_message.start_with?('git-annex in')
end
def old_commit?(commit)
commit.refs(project.repository).any?
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment