There will be about 1h of downtime on 2020-03-02 at 13:00 UTC+1 (change of servers and upgrade to Heptapod 0.20.0 final)

Commit 653bb379 authored by Georges Racinet's avatar Georges Racinet 🦑

Commit model: avoid using `project`

For a while now, repositories have not necessarily been tied to
Projects, but to more general "containers". This happens, e.g.,
with Snippets, Group Wikis.

Besides, even on Mercurial Projects, Snippets repositories are
Git.

It is safer to let the Repository model handle that gracefully.

--HG--
branch : heptapod
parent 92fedb897401
......@@ -27,7 +27,7 @@ class Commit
attr_reader :container
delegate :repository, to: :container
delegate :project, to: :repository, allow_nil: true
delegate :project, :mercurial?, to: :repository, allow_nil: true
MIN_SHA_LENGTH = Gitlab::Git::Commit::MIN_SHA_LENGTH
HG_SHORT_NODE_LAST_CHAR = Gitlab::Mercurial::SHORT_NODE_LAST_CHAR
......@@ -335,11 +335,11 @@ def short_id
end
def hgsha
@raw.hgsha if project.mercurial?
@raw.hgsha if mercurial?
end
def parent_hgid
@raw.parent_hgid if project.mercurial?
@raw.parent_hgid if mercurial?
end
def diff_refs
......
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