diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-30 06:51:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-30 09:46:29 -0700 |
commit | 05a51f7984e62a8eaf02a8b8dc7269325fb26d9b (patch) | |
tree | ff0ea1af15d452b4830b6e8de0db8dab1d684ce4 /core/git-access.c | |
parent | 78d420ac322507596f010fc639924f052c14ed82 (diff) | |
download | subsurface-05a51f7984e62a8eaf02a8b8dc7269325fb26d9b.tar.gz |
Only create the path to no cloud local storage once
This required a small change to the helper function, but this seemed
totally worth it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/git-access.c')
-rw-r--r-- | core/git-access.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/git-access.c b/core/git-access.c index 0e012b082..fe9a27452 100644 --- a/core/git-access.c +++ b/core/git-access.c @@ -928,7 +928,12 @@ struct git_repository *is_git_repository(const char *filename, const char **bran int git_create_local_repo(const char *filename) { git_repository *repo; - int ret = git_repository_init(&repo, filename, false); + char *path = strdup(filename); + char *branch = strchr(path, '['); + if (branch) + *branch = '\0'; + int ret = git_repository_init(&repo, path, false); + free(path); if (ret != 0) (void)report_error("Create local repo failed with error code %d", ret); return ret; |