Skip to content

Commit

Permalink
Merge 567b74c into 669f926
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Oct 17, 2013
2 parents 669f926 + 567b74c commit 9b17294
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -32,6 +32,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Noah McCann](https://github.com/nmccann)
[#29](https://github.com/CocoaPods/Core/pull/29)

* Allow using local git based spec repositories which do not have a remote.
[Kyle Fuller](https://github.com/kylef)
[#1378](https://github.com/CocoaPods/CocoaPods/issues/1378)

## 0.26.2
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.26.1...0.26.2)
Expand Down
13 changes: 12 additions & 1 deletion lib/cocoapods/sources_manager.rb
Expand Up @@ -145,7 +145,7 @@ def update(source_name = nil, show_output = false)
raise Informative, "The `#{source_name}` repo is not a git repo." unless git_repo?(specified_source.repo)
sources = [specified_source]
else
sources = aggregate.all.select { |source| git_repo?(source.repo) }
sources = aggregate.all.select { |source| git_repo?(source.repo) && has_git_remote?(source.repo) }
end

sources.each do |source|
Expand All @@ -171,6 +171,17 @@ def git_repo?(dir)
$?.exitstatus.zero?
end

# Returns whether a source GIT repository has a remote
#
# @param [Pathname] dir
# The directory where the source is stored.
#
# @return [Bool] Wether the given GIT repository has a remote endpoint.
#
def has_git_remote?(dir)
! Dir.chdir(dir) { next git!('remote') }.strip.empty?
end

# Checks the version information of the source with the given directory.
# It raises if the source is not compatible and if there is CocoaPods
# update it informs the user.
Expand Down

0 comments on commit 9b17294

Please sign in to comment.