Skip to content

Commit

Permalink
Return correct errror message for 'git gui' on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschu1 committed Jul 31, 2019
1 parent bb14fbe commit 405aac1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions GVFS/GVFS.Hooks/HooksPlatform/GVFSHooksPlatform.Mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ public static string GetNamedPipeName(string enlistmentRoot)
{
return MacPlatform.GetNamedPipeNameImplementation(enlistmentRoot);
}

public static string GetGitGuiBlockedMessage()
{
return "git gui is not supported in VFS for Git repos on Mac";
}
}
}
6 changes: 6 additions & 0 deletions GVFS/GVFS.Hooks/HooksPlatform/GVFSHooksPlatform.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@ public static string GetUpgradeHighestAvailableVersionDirectory()
{
return WindowsPlatform.GetUpgradeHighestAvailableVersionDirectoryImplementation();
}

public static string GetGitGuiBlockedMessage()
{
return "To access the 'git gui' in a GVFS repo, please invoke 'git-gui.exe' instead.";
}

}
}
8 changes: 1 addition & 7 deletions GVFS/GVFS.Hooks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,7 @@ private static void CheckForLegalCommands(string[] args)
switch (command)
{
case "gui":
// We use RuntimeInformation instead of GVFSPlatform to avoid loading GVFS.Common into GVFS.Hooks
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
ExitWithError("git gui is not supported in VFS for Git repos on Mac");
}

ExitWithError("To access the 'git gui' in a GVFS repo, please invoke 'git-gui.exe' instead.");
ExitWithError(GVFSHooksPlatform.GetGitGuiBlockedMessage());
break;
}
}
Expand Down

0 comments on commit 405aac1

Please sign in to comment.