Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GVFS/GVFS.Common/Git/GitAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private bool TryAnonymousQuery(ITracer tracer, Enlistment enlistment, out bool i
{
ServerGVFSConfig gvfsConfig;
const bool LogErrors = false;
if (configRequestor.TryQueryGVFSConfig(LogErrors, out gvfsConfig, out httpStatus))
if (configRequestor.TryQueryGVFSConfig(LogErrors, out gvfsConfig, out httpStatus, out _))
{
querySucceeded = true;
isAnonymous = true;
Expand Down
4 changes: 3 additions & 1 deletion GVFS/GVFS.Common/Http/ConfigHttpRequestor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ public ConfigHttpRequestor(ITracer tracer, Enlistment enlistment, RetryConfig re
this.repoUrl = enlistment.RepoUrl;
}

public bool TryQueryGVFSConfig(bool logErrors, out ServerGVFSConfig serverGVFSConfig, out HttpStatusCode? httpStatus)
public bool TryQueryGVFSConfig(bool logErrors, out ServerGVFSConfig serverGVFSConfig, out HttpStatusCode? httpStatus, out string errorMessage)
{
serverGVFSConfig = null;
httpStatus = null;
errorMessage = null;

Uri gvfsConfigEndpoint;
string gvfsConfigEndpointString = this.repoUrl + GVFSConstants.Endpoints.GVFSConfig;
Expand Down Expand Up @@ -86,6 +87,7 @@ public bool TryQueryGVFSConfig(bool logErrors, out ServerGVFSConfig serverGVFSCo
if (httpException != null)
{
httpStatus = httpException.StatusCode;
errorMessage = httpException.Message;
}

return false;
Expand Down
5 changes: 3 additions & 2 deletions GVFS/GVFS/CommandLine/GVFSVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,20 @@ protected RetryConfig GetRetryConfig(ITracer tracer, GVFSEnlistment enlistment,
protected ServerGVFSConfig QueryGVFSConfig(ITracer tracer, GVFSEnlistment enlistment, RetryConfig retryConfig)
{
ServerGVFSConfig serverGVFSConfig = null;
string errorMessage = null;
if (!this.ShowStatusWhileRunning(
() =>
{
using (ConfigHttpRequestor configRequestor = new ConfigHttpRequestor(tracer, enlistment, retryConfig))
{
const bool LogErrors = true;
return configRequestor.TryQueryGVFSConfig(LogErrors, out serverGVFSConfig, out _);
return configRequestor.TryQueryGVFSConfig(LogErrors, out serverGVFSConfig, out _, out errorMessage);
}
},
"Querying remote for config",
suppressGvfsLogMessage: true))
{
this.ReportErrorAndExit(tracer, "Unable to query /gvfs/config");
this.ReportErrorAndExit(tracer, "Unable to query /gvfs/config" + Environment.NewLine + errorMessage);
}

return serverGVFSConfig;
Expand Down