summaryrefslogtreecommitdiffstats
path: root/gitautodeploy/wrappers/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitautodeploy/wrappers/git.py')
-rw-r--r--gitautodeploy/wrappers/git.py10
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'])