MCPcopy Create free account
hub / github.com/blobcache/blobcache / TestPushBranch

Function TestPushBranch

src/schema/bcgit/remote_test.go:78–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestPushBranch(t *testing.T) {
79 ctx := testutil.Context(t)
80 te := setup(t)
81 bc := te.Service
82
83 rem := NewRemote(bc, te.Volume)
84 gitInit(t, te)
85 cmd(t, te, "git", "remote", "add", "test1", FmtURL(te.URL))
86 for i := range 10 {
87 putFile(t, te, "file1.txt", fmt.Appendf(nil, "hello world %d", i))
88 gitCommit(t, te, "file1.txt")
89 gitPush(t, te, "test1", "master")
90 }
91
92 // check what's there
93 it, err := rem.OpenIterator(ctx)
94 require.NoError(t, err)
95 actualRefs, err := streams.Collect(ctx, it, 1<<20)
96 require.NoError(t, err)
97 require.Len(t, actualRefs, 1)
98 require.NoError(t, it.Close())
99}
100
101func TestPushPull(t *testing.T) {
102 te1 := setup(t)

Callers

nothing calls this directly

Calls 12

OpenIteratorMethod · 0.95
ContextFunction · 0.92
NewRemoteFunction · 0.85
gitInitFunction · 0.85
cmdFunction · 0.85
FmtURLFunction · 0.85
putFileFunction · 0.85
gitCommitFunction · 0.85
gitPushFunction · 0.85
setupFunction · 0.70
LenMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected