lib/rip/packages/git_package.rb in rip-0.0.4 vs lib/rip/packages/git_package.rb in rip-0.0.5

- old
+ new

@@ -41,11 +41,11 @@ end end def unpack! Dir.chdir cache_path do - git_reset_hard(version) + git_reset_hard version_is_branch? ? "origin/#{version}" : version git_submodule_init git_submodule_update end end @@ -58,10 +58,14 @@ return false if git_ls_remote(source).size == 0 return true if !@version fetch Dir.chdir(cache_path) do - git_cat_file(@version).size > 0 + git_cat_file(@version).size > 0 || version_is_branch? end + end + + def version_is_branch? + git_cat_file("origin/#{version}").size > 0 end end end