Skip to content

Commit

Permalink
Merge 7c015f9 into 23abea7
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Sep 28, 2013
2 parents 23abea7 + 7c015f9 commit 19c4111
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
* Added the `documentation_url` DSL attribute to the specifications.
[#1273](https://github.com/CocoaPods/CocoaPods/pull/1273)

* 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)

###### Bug Fixes

* The search paths of vendored frameworks and libraries now are always
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 19c4111

Please sign in to comment.