Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
fixed path issue with special characters (#924)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Kneidl <[email protected]>
  • Loading branch information
sharpSteff and Stefan Kneidl authored May 13, 2020
1 parent 8ce28ea commit 84b6016
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions NuKeeper.Git/LibGit2SharpDiscoveryDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task<bool> IsGitRepo(Uri repositoryUri)
return false;
}

return Repository.IsValid(discovered.AbsolutePath);
return Repository.IsValid(Uri.UnescapeDataString(discovered.AbsolutePath));
}

public async Task<IEnumerable<GitRemote>> GetRemotes(Uri repositoryUri)
Expand All @@ -38,7 +38,7 @@ public async Task<IEnumerable<GitRemote>> GetRemotes(Uri repositoryUri)
return Enumerable.Empty<GitRemote>();
}

var discover = Repository.Discover(repositoryUri.AbsolutePath);
var discover = Repository.Discover(Uri.UnescapeDataString(repositoryUri.AbsolutePath));

var gitRemotes = new List<GitRemote>();
using (var repo = new Repository(discover))
Expand Down Expand Up @@ -70,7 +70,7 @@ public Task<Uri> DiscoverRepo(Uri repositoryUri)
{
return Task.Run(() =>
{
var discovery = Repository.Discover(repositoryUri.AbsolutePath);
var discovery = Repository.Discover(Uri.UnescapeDataString(repositoryUri.AbsolutePath));

if (string.IsNullOrEmpty(discovery))
{
Expand Down
4 changes: 2 additions & 2 deletions NuKeeper/Engine/GitRepositoryEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public async Task<int> Run(RepositorySettings repository,
IFolder folder;
if (repository.IsLocalRepo)
{
folder = new Folder(_logger, new DirectoryInfo(repository.RemoteInfo.LocalRepositoryUri.AbsolutePath));
settings.WorkingFolder = new Folder(_logger, new DirectoryInfo(repository.RemoteInfo.WorkingFolder.AbsolutePath));
folder = new Folder(_logger, new DirectoryInfo(Uri.UnescapeDataString(repository.RemoteInfo.LocalRepositoryUri.AbsolutePath)));
settings.WorkingFolder = new Folder(_logger, new DirectoryInfo(Uri.UnescapeDataString(repository.RemoteInfo.WorkingFolder.AbsolutePath)));
repositoryData.IsLocalRepo = repository.IsLocalRepo;

if (!repositoryData.IsFork) //check if we are on a fork. If not on a fork we set the remote to the locally found remote
Expand Down

0 comments on commit 84b6016

Please sign in to comment.