GitDownloadStrategy: factor out checkout args
This commit is contained in:
parent
612745352d
commit
145647fc45
@ -411,15 +411,19 @@ class GitDownloadStrategy < AbstractDownloadStrategy
|
|||||||
@clone.cd { update_submodules } if submodules?
|
@clone.cd { update_submodules } if submodules?
|
||||||
end
|
end
|
||||||
|
|
||||||
def checkout
|
def checkout_args
|
||||||
ref = case @spec
|
ref = case @spec
|
||||||
when :branch, :tag, :revision then @ref
|
when :branch, :tag, :revision then @ref
|
||||||
else `git symbolic-ref refs/remotes/origin/HEAD`.strip.split("/").last
|
else `git symbolic-ref refs/remotes/origin/HEAD`.strip.split("/").last
|
||||||
end
|
end
|
||||||
|
|
||||||
nostdout do
|
args = %w{checkout}
|
||||||
quiet_safe_system @@git, 'checkout', { :quiet_flag => '-q' }, ref, '--'
|
args << { :quiet_flag => '-q' }
|
||||||
|
args << ref
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def checkout
|
||||||
|
nostdout { quiet_safe_system @@git, *checkout_args }
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_submodules
|
def update_submodules
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user