lib/licensed/git.rb in licensed-2.8.0 vs lib/licensed/git.rb in licensed-2.9.0
- old
+ new
@@ -9,10 +9,12 @@
# Returns the root of the current git repository
# or nil if not in a git repository.
def repository_root
return unless available?
- Licensed::Shell.execute("git", "rev-parse", "--show-toplevel", allow_failure: true)
+ root = Licensed::Shell.execute("git", "rev-parse", "--show-toplevel", allow_failure: true)
+ return nil if root.empty?
+ root
end
# Returns true if a git repository is found, false otherwise
def git_repo?
!repository_root.to_s.empty?