diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-06-29 10:02:22 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-06-29 10:02:22 +0300 |
commit | d8f0db0197eb05610b3c1dacc750b386e04d2fc7 (patch) | |
tree | 8aa48ea56aecad4d55daf273c58748c91d34dbae /app/models/repository.rb | |
parent | 4473b685d6a64263eca6f87567fd2a0529802071 (diff) |
Use root ref instead of HEAD to find latest repository commit
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 3056c20516a..7c112715e49 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -99,11 +99,11 @@ class Repository "#<#{self.class.name}:#{@disk_path}>" end - def commit(ref = 'HEAD') + def commit(ref = nil) return nil unless exists? return ref if ref.is_a?(::Commit) - find_commit(ref) + find_commit(ref || root_ref) end # Finding a commit by the passed SHA |