You've already forked agentic-coding-workflow
feat(infra/git): clone/fetch/push/commit/status verbs + integration tests
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCommit_Success(t *testing.T) {
|
||||
t.Parallel()
|
||||
gitAvailable(t)
|
||||
bare := makeBareRepo(t)
|
||||
r := newTestRunner(t)
|
||||
dst := filepath.Join(t.TempDir(), "wc")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
require.NoError(t, r.Clone(ctx, dst, bare, "main", nil))
|
||||
mustGit(t, dst, "config", "user.email", "test@example.com")
|
||||
mustGit(t, dst, "config", "user.name", "Test")
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dst, "new.txt"), []byte("body\n"), 0o644))
|
||||
sha, err := r.Commit(ctx, dst, "add new.txt", true)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, sha, 40)
|
||||
}
|
||||
Reference in New Issue
Block a user