Skip to content

Commit

Permalink
Merge pull request #327 from jeschu1/repourl_fix
Browse files Browse the repository at this point in the history
Use correct repoUrl for credential
  • Loading branch information
jeschu1 authored Oct 4, 2018
2 parents 4fd9e66 + 48f62a2 commit f40e3d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerTestCase
[Category(Categories.MacTODO.M4)]
public class RepairTests : TestsWithEnlistmentPerTestCase
{
[TestCase]
public void NoFixesNeeded()
{
this.Enlistment.UnmountGVFS();

this.Enlistment.Repair();
}

[TestCase]
public void FixesCorruptHeadSha()
{
Expand Down
4 changes: 3 additions & 1 deletion GVFS/GVFS/RepairJobs/GitConfigRepairJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ public override IssueType HasIssue(List<string> messages)

// At this point, we've confirmed that the repo url can be gotten, so we have to
// reinitialize the GitProcess with a valid repo url for 'git credential fill'
string repoUrl = null;
try
{
GVFSEnlistment enlistment = GVFSEnlistment.CreateFromDirectory(
this.Enlistment.EnlistmentRoot,
this.Enlistment.GitBinPath,
this.Enlistment.GVFSHooksRoot);
git = new GitProcess(enlistment);
repoUrl = enlistment.RepoUrl;
}
catch (InvalidRepoException)
{
Expand All @@ -61,7 +63,7 @@ public override IssueType HasIssue(List<string> messages)

string username;
string password;
if (!git.TryGetCredentials(this.Tracer, this.Enlistment.RepoUrl, out username, out password))
if (!git.TryGetCredentials(this.Tracer, repoUrl, out username, out password))
{
messages.Add("Authentication failed. Run 'gvfs log' for more info.");
messages.Add(".git\\config is valid and remote 'origin' is set, but may have a typo:");
Expand Down

0 comments on commit f40e3d6

Please sign in to comment.