Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
5c10da1b
Commit
5c10da1b
authored
Oct 10, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Git] Force a barebone repo for the cache.
Closes #581. Closes #569.
parent
62d84717
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
CHANGELOG.md
CHANGELOG.md
+4
-2
git.rb
lib/cocoapods/downloader/git.rb
+10
-12
No files found.
CHANGELOG.md
View file @
5c10da1b
## Master
## Master
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.15.1...master
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.15.1...master
)
•
[
Xcodeproj
](
https://github.com/CocoaPods/Xcodeproj/compare/0.3.4...master
)
######
Bug fixe
s
######
Enhancement
s
-
The git cache now always uses a barebone repo.
[
#581
](
https://github.com/CocoaPods/CocoaPods/pull/581
)
-
Added support for
`.hh`
headers.
-
Added support for
`.hh`
headers.
[
#576
](
https://github.com/CocoaPods/CocoaPods/pull/576
)
[
#576
](
https://github.com/CocoaPods/CocoaPods/pull/576
)
...
...
lib/cocoapods/downloader/git.rb
View file @
5c10da1b
...
@@ -105,7 +105,7 @@ module Pod
...
@@ -105,7 +105,7 @@ module Pod
# @!group Checking references
# @!group Checking references
# @return [Bool] Wether a reference (
SHA of
tag)
# @return [Bool] Wether a reference (
commit SHA or
tag)
#
#
def
ref_exists?
(
ref
)
def
ref_exists?
(
ref
)
Dir
.
chdir
(
cache_path
)
{
git
"rev-list --max-count=1
#{
ref
}
"
}
Dir
.
chdir
(
cache_path
)
{
git
"rev-list --max-count=1
#{
ref
}
"
}
...
@@ -172,8 +172,15 @@ module Pod
...
@@ -172,8 +172,15 @@ module Pod
# @return [Bool] Wether the cache exits.
# @return [Bool] Wether the cache exits.
#
#
# @note The previous implementation of the cache didn't use a barebone
# git repo. This method takes into account this fact and checks
# that the cache is actually a barebone repo. If the cache was not
# barebone it will be deleted and recreated.
#
def
cache_exist?
def
cache_exist?
cache_path
.
exist?
&&
cache_origin_url
(
cache_path
).
to_s
==
url
.
to_s
cache_path
.
exist?
&&
cache_origin_url
(
cache_path
).
to_s
==
url
.
to_s
&&
Dir
.
chdir
(
cache_path
)
{
git
(
"config core.bare"
).
chomp
==
"true"
}
end
end
# @return [String] The origin URL of the cache with the given directory.
# @return [String] The origin URL of the cache with the given directory.
...
@@ -200,16 +207,7 @@ module Pod
...
@@ -200,16 +207,7 @@ module Pod
#
#
def
update_cache
def
update_cache
UI
.
section
(
" > Updating cache git repo (
#{
cache_path
}
)"
,
''
,
1
)
do
UI
.
section
(
" > Updating cache git repo (
#{
cache_path
}
)"
,
''
,
1
)
do
Dir
.
chdir
(
cache_path
)
do
Dir
.
chdir
(
cache_path
)
{
git!
"remote update"
}
if
git
(
"config core.bare"
).
chomp
==
"true"
git!
"remote update"
else
git!
"reset --hard HEAD"
git!
"clean -d -x -f"
git!
"pull origin master"
git!
"fetch --tags"
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment