Skip to content

Commit

Permalink
Merge pull request #157 from ibrahima/discover-repo-dir
Browse files Browse the repository at this point in the history
Discover repository directory inside subdirectories
  • Loading branch information
mmozuras authored Jun 14, 2016
2 parents c36d3c8 + 5b38515 commit 3472e11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pronto/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def run(path = nil)

formatters = ::Pronto::Formatter.get(options[:formatters])
commit = options[:index] ? :index : options[:commit]
messages = ::Pronto.run(commit, '.', formatters, path)
repo_workdir = ::Rugged::Repository.discover('.').workdir
messages = Dir.chdir(repo_workdir) do
::Pronto.run(commit, '.', formatters, path)
end
exit(messages.count) if options[:'exit-code']
rescue Rugged::RepositoryError
puts '"pronto" should be run from a git repository'
Expand Down

0 comments on commit 3472e11

Please # to comment.