From 2c79eaae593f5669f5f596337f5ac98492cc1127 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 6 Jun 2026 17:45:29 +0000 Subject: testgit: Add config support --- internal/testgit/config.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 internal/testgit/config.go (limited to 'internal/testgit/config.go') diff --git a/internal/testgit/config.go b/internal/testgit/config.go new file mode 100644 index 00000000..2bbadb74 --- /dev/null +++ b/internal/testgit/config.go @@ -0,0 +1,25 @@ +package testgit + +import "testing" + +func (repo *Repo) ConfigGet(tb testing.TB, key string) (string, error) { + tb.Helper() + + return String(repo.Run(tb, nil, "git", "config", "--get", "--end-of-options", key)) +} + +func (repo *Repo) ConfigSet(tb testing.TB, key, value string) error { + tb.Helper() + + _, err := repo.Run(tb, nil, "git", "config", "--end-of-options", key, value) + + return err +} + +func (repo *Repo) ConfigAdd(tb testing.TB, key, value string) error { + tb.Helper() + + _, err := repo.Run(tb, nil, "git", "config", "--add", "--end-of-options", key, value) + + return err +} -- cgit v1.3.1-10-gc9f91