diff --git a/scripts/upgrade-zulip-from-git b/scripts/upgrade-zulip-from-git index 5e0cfdd75b..02ec13d036 100755 --- a/scripts/upgrade-zulip-from-git +++ b/scripts/upgrade-zulip-from-git @@ -46,7 +46,6 @@ get_deployment_lock(error_rerun_script) try: deploy_path = make_deploy_path() if not os.path.exists(LOCAL_GIT_CACHE_DIR): - os.chdir('/srv/') logging.info("Cloning the repository") subprocess.check_call(["git", "clone", "-q", git_url, "--mirror", LOCAL_GIT_CACHE_DIR], stdout=open('/dev/null', 'w')) @@ -54,6 +53,7 @@ try: logging.info("Fetching the latest commits") os.chdir(LOCAL_GIT_CACHE_DIR) + subprocess.check_call(["git", "remote", "set-url", "origin", git_url], preexec_fn=su_to_zulip) subprocess.check_call(["git", "fetch", "-q"], preexec_fn=su_to_zulip) subprocess.check_call(["git", "clone", "-q", "-b", refname, LOCAL_GIT_CACHE_DIR, deploy_path],