Browse files

compare current revision against the parsed hash of the target revision

  • Loading branch information...
1 parent e272e75 commit c3dfd542a9f569c431182f58cdbf671cdd4af5f9 Joshua Sierles committed Jan 7, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/bundler/source.rb
View
6 lib/bundler/source.rb
@@ -333,7 +333,7 @@ def to_s
private
def update
if location.directory?
- fetch if current_revision != @ref
+ fetch if current_revision != revision_for_ref
else
clone
end
@@ -354,6 +354,10 @@ def current_revision
Dir.chdir(location) { `git rev-parse HEAD`.strip }
end
+ def revision_for_ref
+ Dir.chdir(location) { `git rev-parse #{@ref}`.strip }
+ end
+
def checkout
Dir.chdir(location) { `git checkout --quiet #{@ref}` }
end

0 comments on commit c3dfd54

Please sign in to comment.