aboutsummaryrefslogtreecommitdiffstats
path: root/repository/repo_testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository/repo_testing.go')
-rw-r--r--repository/repo_testing.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/repository/repo_testing.go b/repository/repo_testing.go
index 2c8705d6..1d3a3155 100644
--- a/repository/repo_testing.go
+++ b/repository/repo_testing.go
@@ -148,6 +148,11 @@ func RepoDataTest(t *testing.T, repo RepoData) {
require.NoError(t, err)
require.Equal(t, tree1read, tree1)
+ c2, err := repo.ReadCommit(commit2)
+ require.NoError(t, err)
+ c2expected := Commit{Hash: commit2, Parents: []Hash{commit1}, TreeHash: treeHash2}
+ require.Equal(t, c2expected, c2)
+
// Ref
exist1, err := repo.RefExist("refs/bugs/ref1")
@@ -161,6 +166,10 @@ func RepoDataTest(t *testing.T, repo RepoData) {
require.NoError(t, err)
require.True(t, exist1)
+ h, err := repo.ResolveRef("refs/bugs/ref1")
+ require.NoError(t, err)
+ require.Equal(t, commit2, h)
+
ls, err := repo.ListRefs("refs/bugs")
require.NoError(t, err)
require.ElementsMatch(t, []string{"refs/bugs/ref1"}, ls)