Skip to content
Browse files

Merge pull request #17 from jkadijk/master

Support for subdirectories
  • Loading branch information...
2 parents c849204 + 0075937 commit 31fbdd352b5be0c7e35da58ec720036eb2902250 @geelen committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/git-smart/git_repo.rb
View
5 lib/git-smart/git_repo.rb
@@ -2,7 +2,10 @@ class GitRepo
def initialize(dir)
@dir = dir
if !File.exists? File.join(@dir, ".git")
- raise GitSmart::RunFailed.new("You need to run this from within a git directory")
+ @dir = git('rev-parse', '--show-toplevel').chomp
+ if !File.exists? File.join(@dir, ".git")
+ raise GitSmart::RunFailed.new("You need to run this from within a git directory")
+ end
end
end

0 comments on commit 31fbdd3

Please sign in to comment.
Something went wrong with that request. Please try again.