Skip to content

Commit

Permalink
Refactor how we detect git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrocha committed Dec 18, 2024
1 parent 077b5c4 commit 3ab954c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/ruby_lsp/tapioca/addon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
end

require "zlib"
require "open3"
require "ruby_lsp/tapioca/lockfile_diff_parser"

module RubyLsp
Expand Down Expand Up @@ -137,7 +136,11 @@ def file_updated?(change, path)

sig { returns(T::Boolean) }
def git_repo?
Dir.exist?(".git")
require "open3"

_, status = Open3.capture2e("git rev-parse --is-inside-work-tree")

T.must(status.success?)
end

sig { returns(T::Boolean) }
Expand Down

0 comments on commit 3ab954c

Please sign in to comment.