Skip to content

Commit

Permalink
Revert "Issue #31 - Look up the dir hierarchy for .git dir"
Browse files Browse the repository at this point in the history
  • Loading branch information
ivey committed Jun 25, 2014
1 parent bd3e452 commit 792381a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/thor-scmversion/scm_version.rb
Expand Up @@ -5,24 +5,12 @@ class << self
#
# @return [#kind_of? ScmVersion]
def versioner
if is_git?
if(File.exist? (".git"))
return GitVersion
else
return P4Version
end
end

def is_git?
file_exists?(Dir.pwd, '.git')
end

def file_exists?(current_dir, file)
return true if File.exist?(file)
Dir.chdir('..') do
return false if Dir.pwd == current_dir
file_exists?(current_dir, file)
end
end
end

# author Josiah Kiehl <josiah@skirmisher.net>
Expand Down

0 comments on commit 792381a

Please sign in to comment.