Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove P/Invoke. quote argument with single-quote to keep long filename.

  • Loading branch information...
commit a95c7606ce9b571c343c18d9808c4fed73023630 1 parent f75876c
mattn mattn authored
Showing with 1 addition and 14 deletions.
  1. +1 −14 git-credential-winstore/Program.cs
15 git-credential-winstore/Program.cs
View
@@ -15,12 +15,6 @@ namespace Git.Credential.WinStore
{
class Program
{
- [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetShortPathName(
- [MarshalAs(UnmanagedType.LPTStr)] string path,
- [MarshalAs(UnmanagedType.LPTStr)] StringBuilder shortPath,
- int shortPathLength);
-
private static Dictionary<string, Func<IDictionary<string, string>, IEnumerable<Tuple<string, string>>>> _commands = new Dictionary<string, Func<IDictionary<string, string>, IEnumerable<Tuple<string, string>>>>(StringComparer.OrdinalIgnoreCase)
{
{ "get", GetCommand },
@@ -113,14 +107,7 @@ private static void InstallTheApp()
var dest = new FileInfo(Environment.ExpandEnvironmentVariables(@"%AppData%\GitCredStore\git-credential-winstore.exe"));
File.Copy(Assembly.GetExecutingAssembly().Location, dest.FullName, true);
- var path = dest.FullName;
- var shortPath = new StringBuilder(255);
- GetShortPathName(path, shortPath, shortPath.Capacity);
- if (shortPath.Length > 0)
- {
- path = shortPath.ToString().ToLower();
- }
- Process.Start("git", string.Format("config --global credential.helper !\"{0}\"", path.Replace('\\', '/')));
+ Process.Start("git", string.Format("config --global credential.helper \"!'{0}'\"", dest.FullName));
}
static IEnumerable<Tuple<string, string>> GetCommand(IDictionary<string, string> args)
Please sign in to comment.
Something went wrong with that request. Please try again.