build: check reachable git commits

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-03 14:29:43 +01:00
parent a8eb2a7fbe
commit fd5884189c
3 changed files with 22 additions and 1 deletions

View File

@ -46,6 +46,18 @@ func TestGitShortCommit(t *testing.T) {
require.Equal(t, 7, len(out))
}
func TestGitFullCommitErr(t *testing.T) {
Mktmp(t)
c, err := New()
require.NoError(t, err)
GitInit(c, t)
_, err = c.FullCommit()
require.Error(t, err)
require.True(t, IsUnknownRevision(err))
}
func TestGitTagsPointsAt(t *testing.T) {
Mktmp(t)
c, err := New()