diff options
author | Oliver Poignant <oliver@poignant.se> | 2016-08-26 22:56:05 +0200 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2016-08-26 22:56:05 +0200 |
commit | 027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e (patch) | |
tree | 5f6abcaad3a34aa9bace3d1f1abe175202a4091c /gitautodeploy/wrappers/git.py | |
parent | d23233780c4223404b9585b52d3bc993b5626b67 (diff) | |
download | Git-Auto-Deploy-027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e.zip Git-Auto-Deploy-027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e.tar.gz Git-Auto-Deploy-027d1fb8ddbfb046b4dada8bd2504db4b9a83c6e.tar.bz2 |
Breaks when using logger in config module
Revert "Move config checks into cli/config module"
This reverts commit 7720ec0cf45bb0b44e3e5b56116545237918d448.
Diffstat (limited to 'gitautodeploy/wrappers/git.py')
-rw-r--r-- | gitautodeploy/wrappers/git.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gitautodeploy/wrappers/git.py b/gitautodeploy/wrappers/git.py index 9bca474..910e9f6 100644 --- a/gitautodeploy/wrappers/git.py +++ b/gitautodeploy/wrappers/git.py @@ -56,6 +56,11 @@ class GitWrapper(): logger = logging.getLogger() logger.info("Updating repository %s" % repo_config['path']) + # Only pull if there is actually a local copy of the repository + if 'path' not in repo_config: + logger.info('No local repository path configured, no pull will occure') + return 0 + commands = [] # On Windows, bash command needs to be run using bash.exe. This assumes bash.exe @@ -95,6 +100,11 @@ class GitWrapper(): logger = logging.getLogger() logger.info("Cloning repository %s" % repo_config['path']) + # Only pull if there is actually a local copy of the repository + if 'path' not in repo_config: + logger.info('No local repository path configured, no clone will occure') + return 0 + commands = [] commands.append('unset GIT_DIR') commands.append('git clone --recursive ' + repo_config['url'] + ' -b ' + repo_config['branch'] + ' ' + repo_config['path']) |