phase1: improve Git cloning on the master
authorJo-Philipp Wich <jo@mein.io>
Mon, 28 Nov 2016 18:28:07 +0000 (19:28 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 28 Nov 2016 18:28:07 +0000 (19:28 +0100)
Avoid switching branches later and checkout the proper branch right away.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase1/master.cfg

index 2e7c195ff8bf0add79dc3d8d0f67fe9c53364c20..2ae92f1aef76e57cf350663a9a45e55e9bf5b4e3 100644 (file)
@@ -96,10 +96,8 @@ if ini.has_option("gpg", "passfile"):
 targets = [ ]
 
 if not os.path.isdir(home_dir+'/source.git'):
-       subprocess.call(["git", "clone", "--depth=1", repo_url, home_dir+'/source.git'])
-       subprocess.call(["git", "checkout", repo_branch], cwd = home_dir+'/source.git')
+       subprocess.call(["git", "clone", "--depth=1", "--branch="+repo_branch, repo_url, home_dir+'/source.git'])
 else:
-       subprocess.call(["git", "checkout", repo_branch], cwd = home_dir+'/source.git')
        subprocess.call(["git", "pull"], cwd = home_dir+'/source.git')
 
 findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'],