Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Don't print git gem shas twice during bundle show
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Apr 3, 2010
1 parent 6f45141 commit f69931f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bundler/rubygems_ext.rb
Expand Up @@ -19,9 +19,9 @@ def groups

def git_version
if @loaded_from && File.exist?(File.join(full_gem_path, ".git"))
rev = Dir.chdir(full_gem_path){ `git rev-parse HEAD`.strip }
sha = Dir.chdir(full_gem_path){ `git rev-parse HEAD`.strip }
branch = full_gem_path.split("-")[3]
branch ? " #{branch}-#{rev[0...6]}" : " #{rev[0...6]}"
(branch && branch != sha) ? " #{branch}-#{sha[0...6]}" : " #{sha[0...6]}"
end
end

Expand Down
10 changes: 10 additions & 0 deletions spec/other/show_spec.rb
Expand Up @@ -65,4 +65,14 @@
bundle :show
out.should include("foo (1.0 omg-#{@revision}")
end

it "doesn't print the branch when tied to a ref" do
sha = revision_for(lib_path("foo-1.0"))
install_gemfile <<-G
gem "foo", :git => "#{lib_path('foo-1.0')}", :ref => "#{sha}"
G

bundle :show
out.should include("foo (1.0 #{sha[0...6]})")
end
end

0 comments on commit f69931f

Please sign in to comment.