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
3 changes: 2 additions & 1 deletion GVFS/GVFS.Common/FileSystem/HooksInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ static HooksInstaller()
public static string MergeHooksData(string[] defaultHooksLines, string filename, string hookName)
{
IEnumerable<string> valuableHooksLines = defaultHooksLines.Where(line => !string.IsNullOrEmpty(line.Trim()));
string absolutePathToHooksExecutable = Path.Combine(ExecutingDirectory, GVFSPlatform.Instance.Constants.GVFSHooksExecutableName);
/* Wrap in quotes to handle spaces in the path */
string absolutePathToHooksExecutable = $"\"{Path.Combine(ExecutingDirectory, GVFSPlatform.Instance.Constants.GVFSHooksExecutableName)}\"";

if (valuableHooksLines.Contains(GVFSPlatform.Instance.Constants.GVFSHooksExecutableName, GVFSPlatform.Instance.Constants.PathComparer))
{
Expand Down
4 changes: 1 addition & 3 deletions GVFS/GVFS.UnitTests/CommandLine/HooksInstallerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ public class HooksInstallerTests
{
private const string Filename = "hooksfile";
private readonly string expectedAbsoluteGvfsHookPath =
Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
GVFSPlatform.Instance.Constants.GVFSHooksExecutableName);
$"\"{Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), GVFSPlatform.Instance.Constants.GVFSHooksExecutableName)}\"";

[TestCase]
[Category(CategoryConstants.ExceptionExpected)]
Expand Down