diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-06-20 15:10:44 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-06-21 09:23:41 +0400 |
commit | f62b134d4d553025b28aa3933ab5557cbc54abde (patch) | |
tree | eefa344ad8b09e80b317fbf4429c23d044aa1390 /LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs | |
parent | d7e70a4552bb680720c2c5082d654ca36595d260 (diff) |
Leverage Touch() to generate test files
Diffstat (limited to 'LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs')
-rw-r--r-- | LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs index da7366be..d559a5d3 100644 --- a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs +++ b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs @@ -83,8 +83,9 @@ namespace LibGit2Sharp.Tests.TestHelpers protected void CreateCorruptedDeadBeefHead(string repoPath) { const string deadbeef = "deadbeef"; - string headPath = string.Format("{0}refs/heads/{1}", repoPath, deadbeef); - File.WriteAllText(headPath, string.Format("{0}{0}{0}{0}{0}\n", deadbeef)); + string headPath = string.Format("refs/heads/{0}", deadbeef); + + Touch(repoPath, headPath, string.Format("{0}{0}{0}{0}{0}\n", deadbeef)); } protected SelfCleaningDirectory BuildSelfCleaningDirectory() @@ -212,7 +213,7 @@ namespace LibGit2Sharp.Tests.TestHelpers }; } - protected string Touch(string parent, string file, string content = null) + protected static string Touch(string parent, string file, string content = null) { string filePath = Path.Combine(parent, file); string dir = Path.GetDirectoryName(filePath); |