Skip to content

Commit 492f454

Browse files
committed
Add a note about the style of git tests
1 parent d97e8fe commit 492f454

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git/git_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ func TestCommitBody(t *testing.T) {
4242
}
4343
}
4444

45+
/*
46+
NOTE: below this are stubbed git tests, i.e. those that do not actually invoke `git`. If possible, utilize
47+
`setGitDir()` to allow new tests to interact with `git`. For write operations, you can use `t.TempDir()` to
48+
host a temporary git repository that is safe to be changed.
49+
*/
50+
4551
func Test_UncommittedChangeCount(t *testing.T) {
4652
type c struct {
4753
Label string

0 commit comments

Comments
 (0)