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
f33d3284
Commit
f33d3284
authored
Sep 11, 2012
by
Ray Lillywhite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update a pod's cached git repo if the specified branch isn't found.
parent
f0541a81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
git.rb
lib/cocoapods/downloader/git.rb
+9
-3
No files found.
lib/cocoapods/downloader/git.rb
View file @
f33d3284
...
@@ -79,6 +79,7 @@ module Pod
...
@@ -79,6 +79,7 @@ module Pod
git!
"reset --hard HEAD"
git!
"reset --hard HEAD"
git!
"clean -d -x -f"
git!
"clean -d -x -f"
git!
"pull origin master"
git!
"pull origin master"
git!
"fetch"
git!
"fetch --tags"
git!
"fetch --tags"
end
end
end
end
...
@@ -95,10 +96,15 @@ module Pod
...
@@ -95,10 +96,15 @@ module Pod
raise
Informative
,
"[!] Cache unable to find git reference `
#{
ref
}
' for `
#{
url
}
'."
.
red
unless
ref_exists?
(
ref
)
raise
Informative
,
"[!] Cache unable to find git reference `
#{
ref
}
' for `
#{
url
}
'."
.
red
unless
ref_exists?
(
ref
)
end
end
def
ensure_remote_branch_exists
(
branch
)
def
branch_exists?
(
branch
)
Dir
.
chdir
(
cache_path
)
{
git
"branch -r | grep
#{
branch
}
$"
}
# check for remote branch and do suffix matching ($ anchor)
Dir
.
chdir
(
cache_path
)
{
git
"branch -r | grep
#{
branch
}
$"
}
# check for remote branch and do suffix matching ($ anchor)
return
if
$?
==
0
$?
==
0
raise
Informative
,
"[!] Cache unable to find git reference `
#{
branch
}
' for `
#{
url
}
' (
#{
$?
}
)."
.
red
end
def
ensure_remote_branch_exists
(
branch
)
return
if
branch_exists?
(
branch
)
update_cache
raise
Informative
,
"[!] Cache unable to find git reference `
#{
branch
}
' for `
#{
url
}
' (
#{
$?
}
)."
.
red
unless
branch_exists?
(
branch
)
end
end
def
download_head
def
download_head
...
...
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