From cec642b4d21c55cdddbb57067565f69ca080bf1e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 12 Jan 2018 23:58:33 +0100 Subject: [PATCH] Create local cache and push to remote for any remote repository This used to be done only for cloud repositories. Signed-off-by: Berthold Stoeger --- core/git-access.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/core/git-access.c b/core/git-access.c index 13996fbbe..bb5acbec6 100644 --- a/core/git-access.c +++ b/core/git-access.c @@ -747,7 +747,7 @@ static git_repository *create_local_repo(const char *localdir, const char *remot } char *pattern = format_string("reference 'refs/remotes/origin/%s' not found", branch); // it seems that we sometimes get 'Reference' and sometimes 'reference' - if (strstr(remote, prefs.cloud_git_url) && includes_string_caseinsensitive(msg, pattern)) { + if (includes_string_caseinsensitive(msg, pattern)) { /* we're trying to open the remote branch that corresponds * to our cloud storage and the branch doesn't exist. * So we need to create the branch and push it to the remote */ @@ -794,18 +794,16 @@ static struct git_repository *get_remote_repo(const char *localdir, const char * } return update_local_repo(localdir, remote, branch, rt); } else { - /* we have no local cache yet */ - if (is_subsurface_cloud) { - /* and take us temporarly online to create a local and - * remote cloud repo. - */ - git_repository *ret; - bool glo = prefs.git_local_only; - prefs.git_local_only = false; - ret = create_local_repo(localdir, remote, branch, rt); - prefs.git_local_only = glo; - return ret; - } + /* We have no local cache yet. + * Take us temporarly online to create a local and + * remote cloud repo. + */ + git_repository *ret; + bool glo = prefs.git_local_only; + prefs.git_local_only = false; + ret = create_local_repo(localdir, remote, branch, rt); + prefs.git_local_only = glo; + return ret; } /* all normal cases are handled above */