diff options
author | Torben <torben.letorbi@gmail.com> | 2015-12-04 17:17:53 +0100 |
---|---|---|
committer | Torben <torben.letorbi@gmail.com> | 2015-12-11 10:23:13 +0100 |
commit | c031f038193f66b3692267b1370fcc5dd2ab82fa (patch) | |
tree | 9479708f6b099a529eb9e354019136073e934d96 /GitAutoDeploy.py | |
parent | f4af71de9f126905533c924e1810c5f4b3e1aabb (diff) | |
download | Git-Auto-Deploy-c031f038193f66b3692267b1370fcc5dd2ab82fa.zip Git-Auto-Deploy-c031f038193f66b3692267b1370fcc5dd2ab82fa.tar.gz Git-Auto-Deploy-c031f038193f66b3692267b1370fcc5dd2ab82fa.tar.bz2 |
Add branch option to clone command line
Diffstat (limited to 'GitAutoDeploy.py')
-rwxr-xr-x | GitAutoDeploy.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py index 32bc525..7a809a4 100755 --- a/GitAutoDeploy.py +++ b/GitAutoDeploy.py @@ -80,10 +80,13 @@ class GitWrapper(): return int(res) @staticmethod - def clone(url, path): + def clone(url, branch, path): from subprocess import call - call(['git clone --recursive %s %s' % (url, path)], shell=True) + if branch: + call(['git clone --recursive %s -b %s %s' % (url, branch, path)], shell=True) + else: + call(['git clone --recursive %s %s' % (url, path)], shell=True) @staticmethod @@ -435,7 +438,7 @@ class GitAutoDeploy(object): if not os.path.isdir(repo_config['path']): print "Directory %s not found" % repo_config['path'] - GitWrapper.clone(url=repo_config['url'], path=repo_config['path']) + GitWrapper.clone(url=repo_config['url'], branch=repo_config['branch'], path=repo_config['path']) if not os.path.isdir(repo_config['path']): print "Unable to clone repository %s" % repo_config['url'] |