lib/grit/git.rb in gitlab-grit-2.6.11 vs lib/grit/git.rb in gitlab-grit-2.6.12

- old
+ new

@@ -88,12 +88,16 @@ self.git_timeout = 10 self.git_max_size = 5242880 # 5.megabytes def self.with_timeout(timeout = 10) old_timeout = Grit::Git.git_timeout - Grit::Git.git_timeout = timeout - yield - Grit::Git.git_timeout = old_timeout + + begin + Grit::Git.git_timeout = timeout + yield + ensure + Grit::Git.git_timeout = old_timeout + end end attr_accessor :git_dir, :bytes_read, :work_tree def initialize(git_dir, options={})