summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2018-03-02 21:04:32 +0100
committerAhmad Sherif <me@ahmadsherif.com>2018-03-05 17:14:30 +0100
commit2cc43aaaf3162db8c584df3bb9d1a42d92084fae (patch)
treeb4977e107e95e4f976e885090a6bebe7fe4b5661
parentddad22c4c4fde6dbec4a9224a3c2500af8bc7bf0 (diff)
downloadgitlab-ce-2cc43aaaf3162db8c584df3bb9d1a42d92084fae.tar.gz
Keep a commit around if its sha is present
Closes gitaly#1054
-rw-r--r--app/models/repository.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 242d9d5f125..1a14afb951a 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -253,7 +253,7 @@ class Repository
# branches or tags, but we want to keep some of these commits around, for
# example if they have comments or CI builds.
def keep_around(sha)
- return unless sha && commit_by(oid: sha)
+ return unless sha.present? && commit_by(oid: sha)
return if kept_around?(sha)