File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,19 +69,7 @@ def eql?(other)
6969
7070 def to_s
7171 begin
72- at = if local?
73- path
74- elsif user_ref = options [ "ref" ]
75- if /\A [a-z0-9]{4,}\z /i . match? ( ref )
76- shortref_for_display ( user_ref )
77- else
78- user_ref
79- end
80- elsif ref
81- ref
82- else
83- current_branch
84- end
72+ at = humanized_ref || current_branch
8573
8674 rev = "at #{ at } @#{ shortref_for_display ( revision ) } "
8775 rescue GitError
@@ -91,6 +79,10 @@ def to_s
9179 uri_with_specifiers ( [ rev , glob_for_display ] )
9280 end
9381
82+ def identifier
83+ uri_with_specifiers ( [ humanized_ref , cached_revision , glob_for_display ] )
84+ end
85+
9486 def uri_with_specifiers ( specifiers )
9587 specifiers . compact!
9688
@@ -256,6 +248,20 @@ def local?
256248
257249 private
258250
251+ def humanized_ref
252+ if local?
253+ path
254+ elsif user_ref = options [ "ref" ]
255+ if /\A [a-z0-9]{4,}\z /i . match? ( ref )
256+ shortref_for_display ( user_ref )
257+ else
258+ user_ref
259+ end
260+ elsif ref
261+ ref
262+ end
263+ end
264+
259265 def serialize_gemspecs_in ( destination )
260266 destination = destination . expand_path ( Bundler . root ) if destination . relative?
261267 Dir [ "#{ destination } /#{ @glob } " ] . each do |spec_path |
Original file line number Diff line number Diff line change 3030 expect ( Dir [ "#{ default_bundle_path } /cache/bundler/git/foo-1.0-*" ] ) . to have_attributes :size => 1
3131 end
3232
33+ it "does not write to cache on bundler/setup" do
34+ cache_path = default_bundle_path . join ( "cache" )
35+ FileUtils . rm_rf ( cache_path )
36+ ruby "require 'bundler/setup'"
37+ expect ( cache_path ) . not_to exist
38+ end
39+
3340 it "caches the git repo globally and properly uses the cached repo on the next invocation" do
3441 simulate_new_machine
3542 bundle "config set global_gem_cache true"
Original file line number Diff line number Diff line change 147147 #{ Bundler ::VERSION }
148148 L
149149
150- original_lockfile = lockfile
151-
152150 # If GH#6743 is present, the first `bundle install` will change the
153151 # lockfile, by flipping the order (`other` would be moved to the top).
154152 #
You can’t perform that action at this time.
0 commit comments