Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't print git gem shas twice during bundle show

  • Loading branch information...
commit f69931f12d20a089caba6574d9a9224f8092d2a0 1 parent 6f45141
@indirect indirect authored
Showing with 12 additions and 2 deletions.
  1. +2 −2 lib/bundler/rubygems_ext.rb
  2. +10 −0 spec/other/show_spec.rb
View
4 lib/bundler/rubygems_ext.rb
@@ -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
View
10 spec/other/show_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.