Skip to content

Commit

Permalink
rescue from exception when fetching git repository root
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jan 4, 2024
1 parent e47382e commit 9394d72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/datadog/ci/utils/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def self.root
return @@root if defined?(@@root)

@@root = exec_git_command("git rev-parse --show-toplevel")
rescue => e
Datadog.logger.debug(
"Unable to read git root: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
)
@@root = nil
end

def self.relative_to_root(path)
Expand Down

0 comments on commit 9394d72

Please sign in to comment.