diff options
| author | Patrick Steinhardt <[email protected]> | 2015-04-24 12:59:29 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <[email protected]> | 2015-04-24 13:01:51 +0200 |
| commit | e300945a3d456af1b619447347cd19a779b7a8f5 (patch) | |
| tree | 3e37d99c8266d130ea54b2080e20199e8073e99e /revparse_test.go | |
| parent | e021457f27654ea0f1ec41963c6da62c168be853 (diff) | |
tests: always clean up temporary repository dirs
Some test repositories are not correctly removed after the tests
did run. Fix by introducing a function that is to be used for
cleaning up temporary test repositories.
Diffstat (limited to 'revparse_test.go')
| -rw-r--r-- | revparse_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/revparse_test.go b/revparse_test.go index c046a20..2ccdca2 100644 --- a/revparse_test.go +++ b/revparse_test.go @@ -1,13 +1,12 @@ package git import ( - "os" "testing" ) func TestRevparse(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) commitId, _ := seedTestRepo(t, repo) @@ -19,7 +18,7 @@ func TestRevparse(t *testing.T) { func TestRevparseSingle(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) commitId, _ := seedTestRepo(t, repo) @@ -31,7 +30,7 @@ func TestRevparseSingle(t *testing.T) { func TestRevparseExt(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) _, treeId := seedTestRepo(t, repo) |
