Skip to content

Commit

Permalink
Merge f8e8219 into 50e19ae
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Sep 19, 2013
2 parents 50e19ae + f8e8219 commit cdebff9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -29,6 +29,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Chris Gummer](https://github.com/chrisgummer)
[#1364](https://github.com/CocoaPods/CocoaPods/issues/1364)

* 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.24.0

###### Enhancements
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 soruce 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 cdebff9

Please sign in to comment.