mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Merge pull request #11 from Embed-Engineering/master
Added test for uninitialized repo's (or wiki's)
This commit is contained in:
@@ -19,6 +19,7 @@ import urllib2
|
||||
|
||||
from github_backup import __version__
|
||||
|
||||
FNULL = open(os.devnull, 'w')
|
||||
|
||||
def log_error(message):
|
||||
if type(message) == str:
|
||||
@@ -357,6 +358,11 @@ def fetch_repository(name, remote_url, local_dir, skip_existing=False):
|
||||
if clone_exists and skip_existing:
|
||||
return
|
||||
|
||||
initalized = subprocess.call('git ls-remote ' + remote_url, stdout=FNULL, stderr=FNULL, shell=True)
|
||||
if initalized == 128:
|
||||
log_info("Skipping {} since it's not initalized".format(name))
|
||||
return
|
||||
|
||||
if clone_exists:
|
||||
log_info('Updating {} in {}'.format(name, local_dir))
|
||||
git_command = ['git', 'fetch', '--all', '--tags', '--prune']
|
||||
|
||||
Reference in New Issue
Block a user