source-controller/pkg/git/libgit2
Eng Zer Jun 10b92da433
test: use `T.TempDir` to create temporary test directory
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-29 23:01:39 +08:00
..
managed test: use `T.TempDir` to create temporary test directory 2022-04-29 23:01:39 +08:00
testdata/git/repo Add libgit2 checkout test with ED25519 key 2022-02-16 10:17:32 +00:00
checkout.go Fix dpanic issue when logging odd number of args 2022-03-25 14:27:04 +01:00
checkout_test.go test: use `T.TempDir` to create temporary test directory 2022-04-29 23:01:39 +08:00
libgit2.go gogit: allow checkout of commit without branch 2021-10-27 00:43:31 +05:30
transport.go Implement Managed Transport for libgit2 2022-03-16 16:22:20 +05:30
transport_test.go Upgrade libgit2 to libgit2-1.3.0-2 2022-02-16 11:39:11 +00:00