Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Degrade to system PATH if default git executable path does not exist #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion src/AppHarbor/GitCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public virtual IList<string> 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
Expand Down Expand Up @@ -65,5 +65,13 @@ private static DirectoryInfo CurrentDirectory
return new DirectoryInfo(Directory.GetCurrentDirectory());
}
}

private string GitExecutable
{
get
{
return _gitExecutable.Exists ? _gitExecutable.FullName : _gitExecutable.Name;
}
}
}
}