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 bd835cd commit b28ebb0
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,6 +13,7 @@
end

require "zlib"
require "open3"

require_relative "lockfile_diff_parser"

Expand Down Expand Up @@ -135,9 +136,11 @@ def file_updated?(change, path)
false
end

sig { returns(T::Boolean) }
sig { returns(T.nilable(T::Boolean)) }
def git_repo?
Dir.exist?(".git")
_, status = Open3.capture2e("git rev-parse --is-inside-work-tree")

status.success?
end

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

0 comments on commit b28ebb0

Please sign in to comment.