mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Gracefully handle cloud authentication failure in verbose mode
If the credential functions return GIT_EUSER, a call to git_remote_fetch fails, but giterr_last() may return NULL. This led to a crash in verbose mode. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
4dbbf1ff27
commit
d4cd4a96ea
1 changed files with 3 additions and 1 deletions
|
@ -607,7 +607,9 @@ int sync_with_remote(git_repository *repo, const char *remote, const char *branc
|
||||||
else
|
else
|
||||||
report_error("Unable to fetch remote '%s'", remote);
|
report_error("Unable to fetch remote '%s'", remote);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr, "remote fetch failed (%s)\n", giterr_last()->message);
|
// If we returned GIT_EUSER during authentication, giterr_last() returns NULL
|
||||||
|
fprintf(stderr, "remote fetch failed (%s)\n",
|
||||||
|
giterr_last() ? giterr_last()->message : "authentication failed");
|
||||||
error = 0;
|
error = 0;
|
||||||
} else {
|
} else {
|
||||||
error = check_remote_status(repo, origin, remote, branch, rt);
|
error = check_remote_status(repo, origin, remote, branch, rt);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue