Skip to content

Commit

Permalink
downloads: Fix checkout on initial clone
Browse files Browse the repository at this point in the history
Moves the "Checking out" output to where checkouts actually happen, to avoid spurious checkout announcements.

Closes Homebrew/legacy-homebrew#45019.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
apjanke authored and MikeMcQuaid committed Oct 16, 2015
1 parent a9b3c92 commit 017a501
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ def fetch
end
end

def stage
ohai "Checking out #{@ref_type} #{@ref}" if @ref_type && @ref
end

def cached_location
@clone
end
Expand Down Expand Up @@ -503,7 +499,10 @@ def fetch_repo(target, url, revision = nil, ignore_externals = false)
args = ["svn", svncommand]
args << url unless target.directory?
args << target
args << "-r" << revision if revision
if revision
ohai "Checking out #{ref}"
args << "-r" << revision
end
args << "--ignore-externals" if ignore_externals
quiet_safe_system(*args)
end
Expand Down Expand Up @@ -645,11 +644,13 @@ def clone_repo
safe_system "git", *clone_args
cached_location.cd do
safe_system "git", "config", "homebrew.cacheversion", cache_version
checkout
update_submodules if submodules?
end
end

def checkout
ohai "Checking out #{@ref_type} #{@ref}" if @ref_type && @ref
quiet_safe_system "git", "checkout", "-f", @ref, "--"
end

Expand Down Expand Up @@ -732,6 +733,7 @@ def stage
dst = Dir.getwd
cached_location.cd do
if @ref_type && @ref
ohai "Checking out #{@ref_type} #{@ref}" if @ref_type && @ref
safe_system hgpath, "archive", "--subrepos", "-y", "-r", @ref, "-t", "files", dst
else
safe_system hgpath, "archive", "--subrepos", "-y", "-t", "files", dst
Expand Down

0 comments on commit 017a501

Please sign in to comment.