4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/gitcycle/pull.rb', line 4
def pull(*args)
exec_git(:pull, args) if args.length > 0
require_git && require_config
current_branch = branches(:current => true)
puts "\nRetrieving branch information from gitcycle.\n".green
branch = get('branch',
'branch[name]' => current_branch,
'include' => [ 'repo' ],
'create' => 0
)
if branch && branch['collab']
merge_remote_branch(
:owner => owner = branch['home'],
:repo => branch['repo']['name'],
:branch => branch['source']
)
elsif branch
merge_remote_branch(
:owner => owner = branch['repo']['owner'],
:repo => branch['repo']['name'],
:branch => branch['source']
)
else
puts "\nRetrieving repo information from gitcycle.\n".green
repo = get('repo')
merge_remote_branch(
:owner => owner = repo['owner'],
:repo => repo['name'],
:branch => current_branch
)
end
unless branch && branch['collab'] || owner == @git_login
merge_remote_branch(
:owner => @git_login,
:repo => @git_repo,
:branch => current_branch
)
end
branch
end
|