mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
git: update gitutil test utilities
- Adds a new GitServeHTTP function to start an http server to serve a target git repository. - Adds a new GitDir helper method to get the path to the .git directory - Updates the GitAdd method to take a variable number of files Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@ -39,9 +39,10 @@ func GitCheckoutBranch(c *Git, tb testing.TB, name string) {
|
||||
require.Empty(tb, out)
|
||||
}
|
||||
|
||||
func GitAdd(c *Git, tb testing.TB, file string) {
|
||||
func GitAdd(c *Git, tb testing.TB, files ...string) {
|
||||
tb.Helper()
|
||||
_, err := fakeGit(c, "add", file)
|
||||
args := append([]string{"add"}, files...)
|
||||
_, err := fakeGit(c, args...)
|
||||
require.NoError(tb, err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user