@@ -42,6 +42,7 @@ def main(conf_dir, out_dir, target_repo, ref):
4242 fp_script .write (script_base )
4343
4444 for target in targets :
45+ is_target_repo = '%s/%s' % (target .owner , target .repo ) == target_repo
4546 # clone the target repo first
4647 if target .repo == "dec-snapshots" :
4748 fp_script .write ('git clone https://github.com/%s/%s.git --depth 1 --branch master\n ' %
@@ -50,14 +51,18 @@ def main(conf_dir, out_dir, target_repo, ref):
5051 fp_script .write ('git init %s && '
5152 'pushd %s && '
5253 'git remote add origin https://github.com/%s/%s.git && '
53- 'git fetch --depth 1 origin %s && '
54+ 'git fetch --depth 1 origin %s%s && '
5455 'git checkout FETCH_HEAD && '
5556 'git submodule update --init --recursive --depth 1 && '
5657 'popd\n ' %
57- (target .repo , target .repo , target .owner , target .repo , target .branch ))
58+ (target .repo , target .repo , target .owner , target .repo , target .branch ,
59+ ' master' if is_target_repo else '' ))
5860 else :
5961 fp_script .write ('git clone --depth 1 --recursive --shallow-submodules -b %s https://github.com/%s/%s.git\n ' %
6062 (target .branch , target .owner , target .repo ))
63+ if target .branch != 'master' and is_target_repo :
64+ fp_script .write ('git -C %s fetch --depth 1 origin master\n ' %
65+ target .repo )
6166
6267 fp_script .write ('CONF=' + conf_dir + '\n ' )
6368
0 commit comments