aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit/config.go
blob: 6ac62b4d40e2e85c7cd55c958846089d746e7255 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
}