summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-10 15:58:11 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-10 15:58:11 +0300
commitdaa55f31d899819069ddbaa9596769a233b5a729 (patch)
tree652d2f2d27cfef15c11bf130fc8c9ff856c3a74c
parent200118357de47c6db69a48eac2b488bfb46e9026 (diff)
downloadgitlab-ce-daa55f31d899819069ddbaa9596769a233b5a729.tar.gz
Dont raise exception when wrong commit id passed
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/models/repository.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 339e485e6d2..93994123a90 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -30,6 +30,8 @@ class Repository
commit = Gitlab::Git::Commit.find(raw_repository, id)
commit = Commit.new(commit) if commit
commit
+ rescue Rugged::OdbError => ex
+ nil
end
def commits(ref, path = nil, limit = nil, offset = nil, skip_merges = false)