upgrade-zulip-from-git: Fix handling of errors in git clone.

Apparently, the `chown -R` would never run if the original clone
attempt had networking errors, leading to inability to use
upgrade-zulip-from-git without manual intervention.
This commit is contained in:
Tim Abbott 2019-06-17 17:24:30 -07:00
parent d7b4de2348
commit a716b09a3f
1 changed files with 1 additions and 0 deletions

View File

@ -48,6 +48,7 @@ try:
logging.info("Cloning the repository")
subprocess.check_call(["git", "clone", "-q", remote_url, "--mirror", LOCAL_GIT_CACHE_DIR],
stdout=open('/dev/null', 'w'))
if os.stat(LOCAL_GIT_CACHE_DIR).st_uid == 0:
subprocess.check_call(["chown", "-R", "zulip:zulip", LOCAL_GIT_CACHE_DIR])
logging.info("Fetching the latest commits")