diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-01-12 23:58:33 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-01-19 09:45:08 +0200 |
commit | cec642b4d21c55cdddbb57067565f69ca080bf1e (patch) | |
tree | b1c3136bc45ade2c32f81b50fc0eaa23daec5533 /core/git-access.c | |
parent | 0b0eacce30fb945e97383405bec61fea5ca84afc (diff) | |
download | subsurface-cec642b4d21c55cdddbb57067565f69ca080bf1e.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/git-access.c')
-rw-r--r-- | core/git-access.c | 24 |
1 files 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 */ |