Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade-zulip-from-git: init, then add remote.

Alex Vandiver5bdc4b3562a3
diff --git a/scripts/lib/upgrade-zulip-from-git b/scripts/lib/upgrade-zulip-from-git
index 4f3addd9bd0..c9b91f836db 100755
--- a/scripts/lib/upgrade-zulip-from-git
+++ b/scripts/lib/upgrade-zulip-from-git
@@ -60,11 +60,15 @@ try:
# Populate LOCAL_GIT_CACHE_DIR with both the requested remote and zulip/zulip.
if not os.path.exists(LOCAL_GIT_CACHE_DIR):
- logging.info("Cloning the repository")
+ logging.info("Making local repository cache")
subprocess.check_call(
- ["git", "clone", "-q", remote_url, LOCAL_GIT_CACHE_DIR],
+ ["git", "init", "--bare", "-q", LOCAL_GIT_CACHE_DIR],
stdout=subprocess.DEVNULL,
)
+ subprocess.check_call(
+ ["git", "remote", "add", "origin", remote_url],
+ cwd=LOCAL_GIT_CACHE_DIR,
+ )
if os.stat(LOCAL_GIT_CACHE_DIR).st_uid == 0:
subprocess.check_call(["chown", "-R", "zulip:zulip", LOCAL_GIT_CACHE_DIR])