Skip to content

Commit

Permalink
Comment out test using deleted repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bording committed Nov 7, 2020
1 parent 4a9af01 commit 2fae75f
Showing 1 changed file with 50 additions and 48 deletions.
98 changes: 50 additions & 48 deletions LibGit2Sharp.Tests/FileHistoryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,56 @@ namespace LibGit2Sharp.Tests
{
public class FileHistoryFixture : BaseFixture
{
[Theory]
[InlineData("https://github.com/nulltoken/follow-test.git")]
public void CanDealWithFollowTest(string url)
{
var scd = BuildSelfCleaningDirectory();
var clonedRepoPath = Repository.Clone(url, scd.DirectoryPath);

using (var repo = new Repository(clonedRepoPath))
{
// $ git log --follow --format=oneline so-renamed.txt
// 88f91835062161febb46fb270ef4188f54c09767 Update not-yet-renamed.txt AND rename into so-renamed.txt
// ef7cb6a63e32595fffb092cb1ae9a32310e58850 Add not-yet-renamed.txt
var fileHistoryEntries = repo.Commits.QueryBy("so-renamed.txt").ToList();
Assert.Equal(2, fileHistoryEntries.Count());
Assert.Equal("88f91835062161febb46fb270ef4188f54c09767", fileHistoryEntries[0].Commit.Sha);
Assert.Equal("ef7cb6a63e32595fffb092cb1ae9a32310e58850", fileHistoryEntries[1].Commit.Sha);

// $ git log --follow --format=oneline untouched.txt
// c10c1d5f74b76f20386d18674bf63fbee6995061 Initial commit
fileHistoryEntries = repo.Commits.QueryBy("untouched.txt").ToList();
Assert.Single(fileHistoryEntries);
Assert.Equal("c10c1d5f74b76f20386d18674bf63fbee6995061", fileHistoryEntries[0].Commit.Sha);

// $ git log --follow --format=oneline under-test.txt
// 0b5b18f2feb917dee98df1210315b2b2b23c5bec Rename file renamed.txt into under-test.txt
// 49921d463420a892c9547a326632ef6a9ba3b225 Update file renamed.txt
// 70f636e8c64bbc2dfef3735a562bb7e195d8019f Rename file under-test.txt into renamed.txt
// d3868d57a6aaf2ae6ed4887d805ae4bc91d8ce4d Updated file under test
// 9da10ef7e139c49604a12caa866aae141f38b861 Updated file under test
// 599a5d821fb2c0a25855b4233e26d475c2fbeb34 Updated file under test
// 678b086b44753000567aa64344aa0d8034fa0083 Updated file under test
// 8f7d9520f306771340a7c79faea019ad18e4fa1f Updated file under test
// bd5f8ee279924d33be8ccbde82e7f10b9d9ff237 Updated file under test
// c10c1d5f74b76f20386d18674bf63fbee6995061 Initial commit
fileHistoryEntries = repo.Commits.QueryBy("under-test.txt").ToList();
Assert.Equal(10, fileHistoryEntries.Count());
Assert.Equal("0b5b18f2feb917dee98df1210315b2b2b23c5bec", fileHistoryEntries[0].Commit.Sha);
Assert.Equal("49921d463420a892c9547a326632ef6a9ba3b225", fileHistoryEntries[1].Commit.Sha);
Assert.Equal("70f636e8c64bbc2dfef3735a562bb7e195d8019f", fileHistoryEntries[2].Commit.Sha);
Assert.Equal("d3868d57a6aaf2ae6ed4887d805ae4bc91d8ce4d", fileHistoryEntries[3].Commit.Sha);
Assert.Equal("9da10ef7e139c49604a12caa866aae141f38b861", fileHistoryEntries[4].Commit.Sha);
Assert.Equal("599a5d821fb2c0a25855b4233e26d475c2fbeb34", fileHistoryEntries[5].Commit.Sha);
Assert.Equal("678b086b44753000567aa64344aa0d8034fa0083", fileHistoryEntries[6].Commit.Sha);
Assert.Equal("8f7d9520f306771340a7c79faea019ad18e4fa1f", fileHistoryEntries[7].Commit.Sha);
Assert.Equal("bd5f8ee279924d33be8ccbde82e7f10b9d9ff237", fileHistoryEntries[8].Commit.Sha);
Assert.Equal("c10c1d5f74b76f20386d18674bf63fbee6995061", fileHistoryEntries[9].Commit.Sha);
}
}
//Looks like nulltoken deleted the repo this test was using

//[Theory]
//[InlineData("https://github.com/nulltoken/follow-test.git")]
//public void CanDealWithFollowTest(string url)
//{
// var scd = BuildSelfCleaningDirectory();
// var clonedRepoPath = Repository.Clone(url, scd.DirectoryPath);

// using (var repo = new Repository(clonedRepoPath))
// {
// // $ git log --follow --format=oneline so-renamed.txt
// // 88f91835062161febb46fb270ef4188f54c09767 Update not-yet-renamed.txt AND rename into so-renamed.txt
// // ef7cb6a63e32595fffb092cb1ae9a32310e58850 Add not-yet-renamed.txt
// var fileHistoryEntries = repo.Commits.QueryBy("so-renamed.txt").ToList();
// Assert.Equal(2, fileHistoryEntries.Count());
// Assert.Equal("88f91835062161febb46fb270ef4188f54c09767", fileHistoryEntries[0].Commit.Sha);
// Assert.Equal("ef7cb6a63e32595fffb092cb1ae9a32310e58850", fileHistoryEntries[1].Commit.Sha);

// // $ git log --follow --format=oneline untouched.txt
// // c10c1d5f74b76f20386d18674bf63fbee6995061 Initial commit
// fileHistoryEntries = repo.Commits.QueryBy("untouched.txt").ToList();
// Assert.Single(fileHistoryEntries);
// Assert.Equal("c10c1d5f74b76f20386d18674bf63fbee6995061", fileHistoryEntries[0].Commit.Sha);

// // $ git log --follow --format=oneline under-test.txt
// // 0b5b18f2feb917dee98df1210315b2b2b23c5bec Rename file renamed.txt into under-test.txt
// // 49921d463420a892c9547a326632ef6a9ba3b225 Update file renamed.txt
// // 70f636e8c64bbc2dfef3735a562bb7e195d8019f Rename file under-test.txt into renamed.txt
// // d3868d57a6aaf2ae6ed4887d805ae4bc91d8ce4d Updated file under test
// // 9da10ef7e139c49604a12caa866aae141f38b861 Updated file under test
// // 599a5d821fb2c0a25855b4233e26d475c2fbeb34 Updated file under test
// // 678b086b44753000567aa64344aa0d8034fa0083 Updated file under test
// // 8f7d9520f306771340a7c79faea019ad18e4fa1f Updated file under test
// // bd5f8ee279924d33be8ccbde82e7f10b9d9ff237 Updated file under test
// // c10c1d5f74b76f20386d18674bf63fbee6995061 Initial commit
// fileHistoryEntries = repo.Commits.QueryBy("under-test.txt").ToList();
// Assert.Equal(10, fileHistoryEntries.Count());
// Assert.Equal("0b5b18f2feb917dee98df1210315b2b2b23c5bec", fileHistoryEntries[0].Commit.Sha);
// Assert.Equal("49921d463420a892c9547a326632ef6a9ba3b225", fileHistoryEntries[1].Commit.Sha);
// Assert.Equal("70f636e8c64bbc2dfef3735a562bb7e195d8019f", fileHistoryEntries[2].Commit.Sha);
// Assert.Equal("d3868d57a6aaf2ae6ed4887d805ae4bc91d8ce4d", fileHistoryEntries[3].Commit.Sha);
// Assert.Equal("9da10ef7e139c49604a12caa866aae141f38b861", fileHistoryEntries[4].Commit.Sha);
// Assert.Equal("599a5d821fb2c0a25855b4233e26d475c2fbeb34", fileHistoryEntries[5].Commit.Sha);
// Assert.Equal("678b086b44753000567aa64344aa0d8034fa0083", fileHistoryEntries[6].Commit.Sha);
// Assert.Equal("8f7d9520f306771340a7c79faea019ad18e4fa1f", fileHistoryEntries[7].Commit.Sha);
// Assert.Equal("bd5f8ee279924d33be8ccbde82e7f10b9d9ff237", fileHistoryEntries[8].Commit.Sha);
// Assert.Equal("c10c1d5f74b76f20386d18674bf63fbee6995061", fileHistoryEntries[9].Commit.Sha);
// }
//}

[Theory]
[InlineData(null)]
Expand Down

0 comments on commit 2fae75f

Please sign in to comment.