From 00777aa8a17a8ba70e336431f2d4ddfe122fd059 Mon Sep 17 00:00:00 2001 From: James Holcomb Date: Sat, 26 Jan 2013 18:09:52 -0600 Subject: [PATCH] Degrade to system PATH if the default git executable path does not exist --- .gitattributes | 22 ++++++++++++++++++++++ src/AppHarbor/GitCommand.cs | 10 +++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/src/AppHarbor/GitCommand.cs b/src/AppHarbor/GitCommand.cs index 2026ada..4a6eda0 100644 --- a/src/AppHarbor/GitCommand.cs +++ b/src/AppHarbor/GitCommand.cs @@ -22,7 +22,7 @@ public virtual IList Execute(string command) var processArguments = new StringBuilder(); processArguments.AppendFormat("/C "); - processArguments.AppendFormat("\"{0}\" ", _gitExecutable.FullName); + processArguments.AppendFormat("\"{0}\" ", GitExecutable); processArguments.AppendFormat("{0} ", command); var process = new Process @@ -65,5 +65,13 @@ private static DirectoryInfo CurrentDirectory return new DirectoryInfo(Directory.GetCurrentDirectory()); } } + + private string GitExecutable + { + get + { + return _gitExecutable.Exists ? _gitExecutable.FullName : _gitExecutable.Name; + } + } } }