diff options
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 0a4431f14c1..ed600e29232 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -3,6 +3,16 @@ class Repository def initialize(path_with_namespace, default_branch) @raw_repository = Gitlab::Git::Repository.new(path_with_namespace, default_branch) + rescue Gitlab::Git::Repository::NoRepository + nil + end + + def exists? + raw_repository + end + + def empty? + raw_repository.empty? end def commit(id = nil) |