diff options
Diffstat (limited to 'internal/testgit/config.go')
| -rw-r--r-- | internal/testgit/config.go | 25 |
1 files changed, 25 insertions, 0 deletions
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 +} |
