From 492f45422ecd796416acaaaaac2e5a37ae43dbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 26 Feb 2021 13:07:38 +0100 Subject: [PATCH] Add a note about the style of git tests --- git/git_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git/git_test.go b/git/git_test.go index 1cd816fa3..685b4d1c0 100644 --- a/git/git_test.go +++ b/git/git_test.go @@ -42,6 +42,12 @@ func TestCommitBody(t *testing.T) { } } +/* + NOTE: below this are stubbed git tests, i.e. those that do not actually invoke `git`. If possible, utilize + `setGitDir()` to allow new tests to interact with `git`. For write operations, you can use `t.TempDir()` to + host a temporary git repository that is safe to be changed. +*/ + func Test_UncommittedChangeCount(t *testing.T) { type c struct { Label string