Method: QB::Repo::Git#from_path!

Defined in:
lib/qb/repo/git.rb

#from_path!(path, use_github_api: false) ⇒ QB::Repo::Git

Instantiate a Package::Git resource for whatever Git repo path is in, raising an error if it's not in one.

Parameters:

  • path (String, Pathname)

    A path that is in the Git repo.

  • use_github_api: (defaults to: false)

    see #from_path

Returns:

Raises:

  • (QB::FSStateError)
    • If we can't find any existing directory to look in based on input_path.

    • If the directory we do find to look in does not seems to be part of a Git repo.



228
229
230
231
232
233
234
235
236
# File 'lib/qb/repo/git.rb', line 228

def from_path! path, use_github_api: false
  from_path( path, use_github_api: use_github_api ).tap { |git|
    if git.nil?
      raise QB::FSStateError,
            "Path #{ path.inspect } does not appear to be in a " +
            "Git repo."
    end
  }
end