@@ -45,7 +45,7 @@ def __init__(self, cwd, remotes, merges, target,
45
45
:param remotes: list of remote linked to the repository. A remote is
46
46
a dict {'name': '', 'url': ''}
47
47
:param: merges list of merge to apply to build the aggregated
48
- repository. A merge is a dict {'remote': '', 'ref': ''}
48
+ repository. A merge is a dict {'remote': '', 'ref': '', 'pin': '' }
49
49
:param target:
50
50
:param shell_command_after: an optional list of shell command to
51
51
execute after the aggregation
@@ -242,17 +242,15 @@ def fetch(self):
242
242
basecmd = ("git" , "fetch" )
243
243
logger .info ("Fetching required remotes" )
244
244
for merge in self .merges :
245
- pin = remote .get ("pin" )
246
245
cmd = basecmd + self ._fetch_options (merge ) + (merge ["remote" ],)
247
246
if merge ["remote" ] not in self .fetch_all :
248
- if pin :
247
+ if merge . get ( " pin" ) :
249
248
# Probably solvable, but a little too tricky for me to
250
249
# figure out right now
251
250
raise GitAggregatorException (
252
251
"Cannot use fetch_all with pin"
253
252
)
254
253
cmd += (merge ["ref" ],)
255
- merge ["pin" ] = pin
256
254
self .log_call (cmd , cwd = self .cwd )
257
255
258
256
def rev_parse (self , ref ):
@@ -311,8 +309,6 @@ def _switch_to_branch(self, branch_name):
311
309
# check if the branch already exists
312
310
logger .info ("Switch to branch %s" , branch_name )
313
311
cmd = ['git' , 'checkout' , '-B' , branch_name ]
314
- if ref is not None :
315
- cmd .append (self .rev_parse (ref ))
316
312
self .log_call (cmd , cwd = self .cwd )
317
313
318
314
def _execute_shell_command_after (self ):
@@ -322,7 +318,12 @@ def _execute_shell_command_after(self):
322
318
323
319
def _merge (self , merge ):
324
320
pin = merge .get ("pin" )
325
- logger .info ("Pull %s, %s, %s" , merge ["remote" ], merge ["ref" ], pin or "no pin" )
321
+ logger .info (
322
+ "Pull %s, %s, %s" ,
323
+ merge ["remote" ],
324
+ merge ["ref" ],
325
+ pin or "no pin"
326
+ )
326
327
cmd = ("git" , "pull" , "--ff" , "--no-rebase" )
327
328
if self .git_version >= (1 , 7 , 10 ):
328
329
# --edit and --no-edit appear with Git 1.7.10
0 commit comments