diff options
Diffstat (limited to 'modules/git/repo_test.go')
-rw-r--r-- | modules/git/repo_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/git/repo_test.go b/modules/git/repo_test.go index c5ce6f4447..15f5e3781c 100644 --- a/modules/git/repo_test.go +++ b/modules/git/repo_test.go @@ -5,6 +5,7 @@ package git import ( + "path/filepath" "testing" "time" @@ -24,3 +25,12 @@ func TestGetLatestCommitTime(t *testing.T) { assert.NoError(t, err) assert.True(t, lct.Unix() > refTime.Unix(), "%d not greater than %d", lct, refTime) } + +func TestRepoIsEmpty(t *testing.T) { + emptyRepo2Path := filepath.Join(testReposDir, "repo2_empty") + repo, err := OpenRepository(emptyRepo2Path) + assert.NoError(t, err) + isEmpty, err := repo.IsEmpty() + assert.NoError(t, err) + assert.True(t, isEmpty) +} |