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

Commit

Permalink
Handle files with a backtick in the name
Browse files Browse the repository at this point in the history
GitLink uses the `Uri` APIs in order to calculate relative file paths.
This API will escape a number of characters, including backtick, when
converting from `string` to `Uri`. These characters are not unescaped
when converting from `Uri` to `string`. Hence the paths produced from
GetRelativePath are incorrect and GitLink can't process the files.

Fixed to unescape the characters once the relative path is calculated.

closes #163
  • Loading branch information
jaredpar committed Jul 6, 2017
1 parent 0f67340 commit 26fb807
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GitLink/Extensions/RepositoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static string GetRelativePath(string target, string relativeTo)

Uri baseUri = new Uri(relativeTo, UriKind.Absolute);
Uri targetUri = new Uri(target, UriKind.Absolute);
return baseUri.MakeRelativeUri(targetUri).ToString();
return Uri.UnescapeDataString(baseUri.MakeRelativeUri(targetUri).ToString());
}
}
}

0 comments on commit 26fb807

Please sign in to comment.