Skip to content

Commit

Permalink
Add optional encoding to Touch()
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Aug 7, 2013
1 parent bcc25ce commit 14ab70e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ private static RepositoryOptions BuildFakeRepositoryOptions(SelfCleaningDirector
};
}

protected static string Touch(string parent, string file, string content = null)
protected static string Touch(string parent, string file, string content = null, Encoding encoding = null)
{
string filePath = Path.Combine(parent, file);
string dir = Path.GetDirectoryName(filePath);
Debug.Assert(dir != null);

Directory.CreateDirectory(dir);

File.WriteAllText(filePath, content ?? string.Empty, Encoding.ASCII);
File.WriteAllText(filePath, content ?? string.Empty, encoding ?? Encoding.ASCII);

return filePath;
}
Expand Down

0 comments on commit 14ab70e

Please sign in to comment.