diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-06-05 02:02:37 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-06-08 04:07:49 +0200 |
| commit | 85fde1fcfbc3fd6000b8fa1a4041b4c314a92b2f (patch) | |
| tree | 80b29ec86120ba092fcd05c05e28e6a65d1f2b13 /reference_test.go | |
| parent | 1011b03e4139580679bb93183a781edd11c22a97 (diff) | |
| parent | 53c158fbd7e5f4dac787f5c3a7107fcb4116f676 (diff) | |
Merge remote-tracking branch 'origin/master' into next
Diffstat (limited to 'reference_test.go')
| -rw-r--r-- | reference_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/reference_test.go b/reference_test.go index 562e276..e891e7a 100644 --- a/reference_test.go +++ b/reference_test.go @@ -1,7 +1,6 @@ package git import ( - "os" "runtime" "sort" "testing" @@ -10,7 +9,7 @@ import ( func TestRefModification(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) commitId, treeId := seedTestRepo(t, repo) @@ -55,7 +54,7 @@ func TestRefModification(t *testing.T) { func TestReferenceIterator(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) loc, err := time.LoadLocation("Europe/Berlin") checkFatal(t, err) @@ -133,7 +132,8 @@ func TestReferenceIterator(t *testing.T) { func TestReferenceOwner(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) + commitId, _ := seedTestRepo(t, repo) ref, err := repo.CreateReference("refs/heads/foo", commitId, true, "") @@ -151,7 +151,7 @@ func TestReferenceOwner(t *testing.T) { func TestUtil(t *testing.T) { repo := createTestRepo(t) - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) commitId, _ := seedTestRepo(t, repo) @@ -192,8 +192,7 @@ func checkRefType(t *testing.T, ref *Reference, kind ReferenceType) { // The failure happens at wherever we were called, not here _, file, line, ok := runtime.Caller(1) if !ok { - t.Fatal() + t.Fatalf("Unable to get caller") } - t.Fatalf("Wrong ref type at %v:%v; have %v, expected %v", file, line, ref.Type(), kind) } |
