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-02 21:04:32 +0100
commita99a21cce23460aae3a63a7bb5bfebe188f6df1f (patch)
tree0af619a4069c185574966902096f85ac47b26c7e
parentddad22c4c4fde6dbec4a9224a3c2500af8bc7bf0 (diff)
downloadgitlab-ce-fix/find-commit-with-empty-rev.tar.gz
Keep note commit around if commit_id is presentfix/find-commit-with-empty-rev
Closes gitaly#1054
-rw-r--r--app/models/note.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index d7a67ec277c..a3e40fce0fe 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -424,7 +424,7 @@ class Note < ActiveRecord::Base
private
def keep_around_commit
- project.repository.keep_around(self.commit_id)
+ project.repository.keep_around(self.commit_id) if self.commit_id.present?
end
def nullify_blank_type