Skip to content

Commit

Permalink
compare current revision against the parsed hash of the target revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Sierles committed Jan 7, 2010
1 parent e272e75 commit c3dfd54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/bundler/source.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c3dfd54

Please sign in to comment.