|
|
@ -40,8 +40,9 @@ func TestRepository_GetCommitBranches(t *testing.T) { |
|
|
|
func TestGetTagCommitWithSignature(t *testing.T) { |
|
|
|
func TestGetTagCommitWithSignature(t *testing.T) { |
|
|
|
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare") |
|
|
|
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare") |
|
|
|
bareRepo1, err := OpenRepository(bareRepo1Path) |
|
|
|
bareRepo1, err := OpenRepository(bareRepo1Path) |
|
|
|
commit, err := bareRepo1.GetCommit("3ad28a9149a2864384548f3d17ed7f38014c9e8a") |
|
|
|
assert.NoError(t, err) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commit, err := bareRepo1.GetCommit("3ad28a9149a2864384548f3d17ed7f38014c9e8a") |
|
|
|
assert.NoError(t, err) |
|
|
|
assert.NoError(t, err) |
|
|
|
assert.NotNil(t, commit) |
|
|
|
assert.NotNil(t, commit) |
|
|
|
assert.NotNil(t, commit.Signature) |
|
|
|
assert.NotNil(t, commit.Signature) |
|
|
@ -52,6 +53,8 @@ func TestGetTagCommitWithSignature(t *testing.T) { |
|
|
|
func TestGetCommitWithBadCommitID(t *testing.T) { |
|
|
|
func TestGetCommitWithBadCommitID(t *testing.T) { |
|
|
|
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare") |
|
|
|
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare") |
|
|
|
bareRepo1, err := OpenRepository(bareRepo1Path) |
|
|
|
bareRepo1, err := OpenRepository(bareRepo1Path) |
|
|
|
|
|
|
|
assert.NoError(t, err) |
|
|
|
|
|
|
|
|
|
|
|
commit, err := bareRepo1.GetCommit("bad_branch") |
|
|
|
commit, err := bareRepo1.GetCommit("bad_branch") |
|
|
|
assert.Nil(t, commit) |
|
|
|
assert.Nil(t, commit) |
|
|
|
assert.Error(t, err) |
|
|
|
assert.Error(t, err) |
|
|
|