diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-07-28 11:13:14 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-29 08:30:08 -0700 |
commit | 794739b4c0827dfba4eab78f639418f7d4da1f44 (patch) | |
tree | 1393d9d672c9bc9ba9bfda131d29419112817ca7 /core/git-access.c | |
parent | 44e8d302effabc305cf79faebbe051eda959f006 (diff) | |
download | subsurface-794739b4c0827dfba4eab78f639418f7d4da1f44.tar.gz |
strstr is a case sensitive compare
strstr is a case sensitive compare and the string reported from
libgit2 reads "reference" and not "Reference". Further investigation
reveals commit 909d5494368a0080 of libgit2. Here, the change is
made from Reference to reference, breaking our rather poor way
of detecting something from an error string. So, to be future-proof
to more libgit2 oddities, it might be wise to use strcasestr
in this situation. But this seems a not fully supported variant of
strstr, so leave it at this point.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'core/git-access.c')
-rw-r--r-- | core/git-access.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/git-access.c b/core/git-access.c index bfb3659bb..fc2c1223a 100644 --- a/core/git-access.c +++ b/core/git-access.c @@ -737,9 +737,9 @@ static git_repository *create_local_repo(const char *localdir, const char *remot fprintf(stderr, "git storage: returned from git_clone() with error %d\n", error); if (error) { char *msg = giterr_last()->message; - int len = sizeof("Reference 'refs/remotes/origin/' not found") + strlen(branch); + int len = sizeof("reference 'refs/remotes/origin/' not found") + strlen(branch); char *pattern = malloc(len); - snprintf(pattern, len, "Reference 'refs/remotes/origin/%s' not found", branch); + snprintf(pattern, len, "reference 'refs/remotes/origin/%s' not found", branch); if (strstr(remote, prefs.cloud_git_url) && strstr(msg, pattern)) { /* we're trying to open the remote branch that corresponds * to our cloud storage and the branch doesn't exist. |