From daa55f31d899819069ddbaa9596769a233b5a729 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 10 Oct 2014 15:58:11 +0300 Subject: [PATCH] Dont raise exception when wrong commit id passed Signed-off-by: Dmitriy Zaporozhets --- app/models/repository.rb | 2 ++ 1 file changed, 2 insertions(+) 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)