I'm not a big fan of "tool modules", especially if they return a hash of unspecified gunk. I know that it's the Ruby way to return big hashes with arbitrary keys, but it's difficult to code for; nobody can remember the "API" for what's in the hash.

I would turn this into a RepositoryInfo class, make the git dir (or subdir) an input parameter, and create reader methods for the interesting stuff. Something like this:

class RepositoryInfo
  attr_reader :recent_commits, :head_commit_ref
  
   #@param [String,Pathname] dir location of the Git repo (or any of its subdirectories)
  def initialize(dir); ...; end
end