Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-06-29 10:02:22 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-06-29 10:02:22 +0300
commitd8f0db0197eb05610b3c1dacc750b386e04d2fc7 (patch)
tree8aa48ea56aecad4d55daf273c58748c91d34dbae /app/models/repository.rb
parent4473b685d6a64263eca6f87567fd2a0529802071 (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.rb4
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