Test dry-run sync does not push · Entire

Test dry-run sync does not push

379c575→main·

Soph·3mo ago·1 file·+41 added/-0 removed

Sessions

683f05e0a6a6View transcript

[?
Can you take a look at the go code (wasm) in /Users/soph/Work/entire/devenv/entire-io-worktree1 based a bit on that I wonder if something like this can be build:Codex·GPT-5.4·1 step](/content/gh/entireio/git-sync/session/019d6d29-8cf7-7fe3-adc9-8c3e4d9d5603#timeline-683f05e0a6a6/index.html)

Changes

1

175 unmodified lines

176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222

175 unmodified lines

}
}

func TestRun_IntegrationDryRunPlansWithoutPush(t *testing.T) {
    sourceRepo, sourceFS := newSourceRepo(t)
    makeCommits(t, sourceRepo, sourceFS, 3)

targetRepo, err := git.Init(memory.NewStorage(), nil)
    if err != nil {
        t.Fatalf("init target repo: %v", err)
    }

sourceServer := newSmartHTTPRepoServerV2(t, sourceRepo)
    targetServer := newSmartHTTPRepoServer(t, targetRepo)
    defer sourceServer.Close()
    defer targetServer.Close()

result, err := Run(context.Background(), Config{
        Source:       Endpoint{URL: sourceServer.RepoURL()},
        Target:       Endpoint{URL: targetServer.RepoURL()},
        ProtocolMode: protocolModeAuto,
        DryRun:       true,
        ShowStats:    true,
    })
    if err != nil {
        t.Fatalf("dry-run plan failed: %v", err)
    }
    if !result.DryRun {
        t.Fatalf("expected dry-run result")
    }
    if result.Pushed != 0 {
        t.Fatalf("expected no pushed refs, got %+v", result)
    }
    if len(result.Plans) == 0 {
        t.Fatalf("expected at least one plan")
    }
    if targetServer.Count(serviceReceivePack, metricPack) != 0 {
        t.Fatalf("expected no receive-pack POSTs during dry-run, got %d", targetServer.Count(serviceReceivePack, metricPack))
    }
    if _, err := targetRepo.Reference(plumbing.NewBranchReferenceName(testBranch), true); err != plumbing.ErrReferenceNotFound {
        t.Fatalf("expected target branch to remain absent, got %v", err)
    }
}

func TestRun_IntegrationProtocolV2Source(t *testing.T) {
    sourceRepo, sourceFS := newSourceRepo(t)
    makeCommits(t, sourceRepo, sourceFS, 4)
``