From 84b6016e43840bf8ab84a09469dcaf3afe2b58e0 Mon Sep 17 00:00:00 2001 From: sharpSteff <30927510+sharpSteff@users.noreply.github.com> Date: Wed, 13 May 2020 11:08:51 +0200 Subject: [PATCH] fixed path issue with special characters (#924) Co-authored-by: Stefan Kneidl --- NuKeeper.Git/LibGit2SharpDiscoveryDriver.cs | 6 +++--- NuKeeper/Engine/GitRepositoryEngine.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NuKeeper.Git/LibGit2SharpDiscoveryDriver.cs b/NuKeeper.Git/LibGit2SharpDiscoveryDriver.cs index 5eef5e72c..2820598b9 100644 --- a/NuKeeper.Git/LibGit2SharpDiscoveryDriver.cs +++ b/NuKeeper.Git/LibGit2SharpDiscoveryDriver.cs @@ -28,7 +28,7 @@ public async Task IsGitRepo(Uri repositoryUri) return false; } - return Repository.IsValid(discovered.AbsolutePath); + return Repository.IsValid(Uri.UnescapeDataString(discovered.AbsolutePath)); } public async Task> GetRemotes(Uri repositoryUri) @@ -38,7 +38,7 @@ public async Task> GetRemotes(Uri repositoryUri) return Enumerable.Empty(); } - var discover = Repository.Discover(repositoryUri.AbsolutePath); + var discover = Repository.Discover(Uri.UnescapeDataString(repositoryUri.AbsolutePath)); var gitRemotes = new List(); using (var repo = new Repository(discover)) @@ -70,7 +70,7 @@ public Task DiscoverRepo(Uri repositoryUri) { return Task.Run(() => { - var discovery = Repository.Discover(repositoryUri.AbsolutePath); + var discovery = Repository.Discover(Uri.UnescapeDataString(repositoryUri.AbsolutePath)); if (string.IsNullOrEmpty(discovery)) { diff --git a/NuKeeper/Engine/GitRepositoryEngine.cs b/NuKeeper/Engine/GitRepositoryEngine.cs index 651b8cf4a..ba1af7541 100644 --- a/NuKeeper/Engine/GitRepositoryEngine.cs +++ b/NuKeeper/Engine/GitRepositoryEngine.cs @@ -62,8 +62,8 @@ public async Task 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