GitLabgitlab-org
cli
main
1//go:build integration
3package checkout
5import (
6 "net/http"
7 "net/http/httptest"
8 "os"
9 "os/exec"
10 "path/filepath"
11 "strings"
12 "testing"
14 "github.com/google/shlex"
15 "github.com/stretchr/testify/assert"
16 "github.com/stretchr/testify/require"
17 "go.uber.org/mock/gomock"
19 gitlab "gitlab.com/gitlab-org/api/client-go/v3"
20 gitlabtesting "gitlab.com/gitlab-org/api/client-go/v3/testing"
22 "gitlab.com/gitlab-org/cli/internal/git"
23 "gitlab.com/gitlab-org/cli/internal/glinstance"
24 "gitlab.com/gitlab-org/cli/internal/glrepo"
25 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
26)
28// Test_MRCheckout_RealGitOutput_Integration runs the checkout command against
29// a real `git` subprocess (no mocked GitRunner) so the captured stdout/stderr
30// contain the actual bytes git emits for `fetch` and `checkout`. This proves
31// the io.Writer plumbing introduced in commit e9bdc3ed (replacing gr.Git with
32// gr.GitWithIO) reaches the user end-to-end, not just at the mock boundary.
33//
34// No GitLab test host is required: the project's clone URL returned by the
35// mocked API points at a bare repo prepared in t.TempDir() and served over
36// HTTP by httptest.
37func Test_MRCheckout_RealGitOutput_Integration(t *testing.T) {
38 originDir := filepath.Join(t.TempDir(), "origin.git")
39 seedDir := filepath.Join(t.TempDir(), "seed")
40 workDir := filepath.Join(t.TempDir(), "work")
42 runGit(t, "", "init", "--bare", "-b", "main", originDir)
44 // Seed: create a branch named feat-new-mr with one commit and push it
45 // into the bare origin.
46 require.NoError(t, os.MkdirAll(seedDir, 0o755))
47 runGit(t, seedDir, "init", "-b", "feat-new-mr")
48 runGit(t, seedDir, "config", "user.email", "test@example.com")
49 runGit(t, seedDir, "config", "user.name", "Integration Test")
50 require.NoError(t, os.WriteFile(filepath.Join(seedDir, "hello.txt"), []byte("hi\n"), 0o644))
51 runGit(t, seedDir, "add", "hello.txt")
52 runGit(t, seedDir, "commit", "-m", "seed commit")
53 runGit(t, seedDir, "push", originDir, "feat-new-mr")
54 remoteSHA := gitOutput(t, seedDir, "rev-parse", "HEAD")
55 originURL := serveOrigin(t, originDir)
57 // Work dir: a normal (non-bare) repo with one commit on main. This is
58 // where the command will fetch/checkout. cwd must point here for git
59 // to operate on the right repo.
60 require.NoError(t, os.MkdirAll(workDir, 0o755))
61 runGit(t, workDir, "init", "-b", "main")
62 runGit(t, workDir, "config", "user.email", "test@example.com")
63 runGit(t, workDir, "config", "user.name", "Integration Test")
64 require.NoError(t, os.WriteFile(filepath.Join(workDir, "main.txt"), []byte("main\n"), 0o644))
65 runGit(t, workDir, "add", "main.txt")
66 runGit(t, workDir, "commit", "-m", "main commit")
67 t.Chdir(workDir)
69 testClient := gitlabtesting.NewTestClient(t)
70 testClient.MockMergeRequests.EXPECT().
71 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any(), gomock.Any()).
72 Return(&gitlab.MergeRequest{
73 BasicMergeRequest: gitlab.BasicMergeRequest{
74 ID: 123,
75 IID: 123,
76 ProjectID: 3,
77 SourceProjectID: 3,
78 SourceBranch: "feat-new-mr",
79 State: "opened",
80 SHA: remoteSHA,
81 },
82 }, nil, nil)
83 testClient.MockProjects.EXPECT().
84 GetProject(gomock.Any(), gomock.Any()).
85 Return(&gitlab.Project{
86 ID: 3,
87 SSHURLToRepo: originURL,
88 HTTPURLToRepo: originURL,
89 }, nil, nil)
91 ios, _, stdout, stderr := cmdtest.TestIOStreams()
92 f := cmdtest.NewTestFactory(ios, cmdtest.WithGitLabClient(testClient.Client), noRemotes)
94 cmd := NewCmdCheckout(f)
95 argv, err := shlex.Split("123")
96 require.NoError(t, err)
97 cmd.SetArgs(argv)
99 _, err = cmd.ExecuteC()
100 require.NoError(t, err, "stdout=%q stderr=%q", stdout.String(), stderr.String())
102 // Real `git fetch` writes its summary line (e.g. "* [new branch] ...")
103 // to stderr. Real `git checkout` writes "Switched to ..." to stderr too.
104 combined := stdout.String() + stderr.String()
105 assert.Contains(t, combined, "[new branch]", "fetch output should be captured; stdout=%q stderr=%q", stdout.String(), stderr.String())
106 assert.Contains(t, combined, "Switched to", "checkout output should be captured; stdout=%q stderr=%q", stdout.String(), stderr.String())
108 // Sanity check: HEAD really points at feat-new-mr — proves the command
109 // did more than just print, it actually performed the checkout.
110 headRef := strings.TrimSpace(readFile(t, filepath.Join(workDir, ".git", "HEAD")))
111 assert.Equal(t, "ref: refs/heads/feat-new-mr", headRef)
112}
114// serveOrigin serves the bare repo over dumb HTTP; update-server-info writes the
115// info/refs file that protocol requires.
116func serveOrigin(t *testing.T, originDir string) string {
117 t.Helper()
118 runGit(t, originDir, "update-server-info")
119 srv := httptest.NewServer(http.FileServer(http.Dir(originDir)))
120 t.Cleanup(srv.Close)
121 return srv.URL + "/"
122}
124func runGit(t *testing.T, cwd string, args ...string) {
125 t.Helper()
126 cmd := exec.Command("git", args...)
127 if cwd != "" {
128 cmd.Dir = cwd
129 }
130 out, err := cmd.CombinedOutput()
131 require.NoErrorf(t, err, "git %s failed: %s", strings.Join(args, " "), string(out))
132}
134func gitOutput(t *testing.T, cwd string, args ...string) string {
135 t.Helper()
136 cmd := exec.Command("git", args...)
137 cmd.Dir = cwd
138 out, err := cmd.CombinedOutput()
139 require.NoErrorf(t, err, "git %s failed: %s", strings.Join(args, " "), string(out))
140 return strings.TrimSpace(string(out))
141}
143func readFile(t *testing.T, path string) string {
144 t.Helper()
145 b, err := os.ReadFile(path)
146 require.NoError(t, err)
147 return string(b)
148}
150// setupDivergedRepo creates a bare origin repo with `feat-new-mr` pointing at
151// one commit, and a working clone with a LOCAL `feat-new-mr` branch pointing
152// at a DIFFERENT commit. Returns originDir, workDir, remoteSHA, localSHA.
153func setupDivergedRepo(t *testing.T) (originDir, workDir, remoteSHA, localSHA string) {
154 t.Helper()
155 originDir = filepath.Join(t.TempDir(), "origin.git")
156 seedDir := filepath.Join(t.TempDir(), "seed")
157 workDir = filepath.Join(t.TempDir(), "work")
159 runGit(t, "", "init", "--bare", "-b", "main", originDir)
161 require.NoError(t, os.MkdirAll(seedDir, 0o755))
162 runGit(t, seedDir, "init", "-b", "feat-new-mr")
163 runGit(t, seedDir, "config", "user.email", "test@example.com")
164 runGit(t, seedDir, "config", "user.name", "Integration Test")
165 require.NoError(t, os.WriteFile(filepath.Join(seedDir, "remote.txt"), []byte("remote\n"), 0o644))
166 runGit(t, seedDir, "add", "remote.txt")
167 runGit(t, seedDir, "commit", "-m", "remote commit")
168 runGit(t, seedDir, "push", originDir, "feat-new-mr")
169 remoteSHA = gitOutput(t, seedDir, "rev-parse", "HEAD")
171 require.NoError(t, os.MkdirAll(workDir, 0o755))
172 runGit(t, workDir, "init", "-b", "main")
173 runGit(t, workDir, "config", "user.email", "test@example.com")
174 runGit(t, workDir, "config", "user.name", "Integration Test")
175 require.NoError(t, os.WriteFile(filepath.Join(workDir, "main.txt"), []byte("main\n"), 0o644))
176 runGit(t, workDir, "add", "main.txt")
177 runGit(t, workDir, "commit", "-m", "main commit")
178 runGit(t, workDir, "checkout", "-b", "feat-new-mr")
179 require.NoError(t, os.WriteFile(filepath.Join(workDir, "local.txt"), []byte("local\n"), 0o644))
180 runGit(t, workDir, "add", "local.txt")
181 runGit(t, workDir, "commit", "-m", "local divergent commit")
182 localSHA = gitOutput(t, workDir, "rev-parse", "HEAD")
184 require.NotEqual(t, remoteSHA, localSHA, "test setup must produce divergent SHAs")
185 return originDir, workDir, remoteSHA, localSHA
186}
188func mockCheckoutMR(t *testing.T, originDir string) *gitlabtesting.TestClient {
189 t.Helper()
190 remoteSHA := gitOutput(t, originDir, "rev-parse", "refs/heads/feat-new-mr")
191 originURL := serveOrigin(t, originDir)
192 testClient := gitlabtesting.NewTestClient(t)
193 testClient.MockMergeRequests.EXPECT().
194 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any(), gomock.Any()).
195 Return(&gitlab.MergeRequest{
196 BasicMergeRequest: gitlab.BasicMergeRequest{
197 ID: 123,
198 IID: 123,
199 ProjectID: 3,
200 SourceProjectID: 3,
201 SourceBranch: "feat-new-mr",
202 State: "opened",
203 SHA: remoteSHA,
204 },
205 }, nil, nil)
206 testClient.MockProjects.EXPECT().
207 GetProject(gomock.Any(), gomock.Any()).
208 Return(&gitlab.Project{
209 ID: 3,
210 SSHURLToRepo: originURL,
211 HTTPURLToRepo: originURL,
212 }, nil, nil)
213 return testClient
214}
216func noRemotes(f *cmdtest.Factory) {
217 f.RemotesStub = func() (glrepo.Remotes, error) {
218 return glrepo.Remotes{}, nil
219 }
220}
222func execCheckout(t *testing.T, testClient *gitlabtesting.TestClient, cli string) error {
223 t.Helper()
224 ios, _, stdout, stderr := cmdtest.TestIOStreams()
225 f := cmdtest.NewTestFactory(ios, cmdtest.WithGitLabClient(testClient.Client), noRemotes)
226 _, err := cmdtest.ExecuteCommand(NewCmdCheckout(f), cli, stdout, stderr)
227 return err
228}
230func Test_MRCheckout_Force_Integration(t *testing.T) {
231 t.Run("--force, on target branch, clean working tree", func(t *testing.T) {
232 originDir, workDir, remoteSHA, _ := setupDivergedRepo(t)
233 t.Chdir(workDir)
235 // Currently on feat-new-mr (the diverged local branch). Working tree clean.
236 require.Equal(t, "feat-new-mr", gitOutput(t, workDir, "symbolic-ref", "--short", "HEAD"))
238 testClient := mockCheckoutMR(t, originDir)
239 require.NoError(t, execCheckout(t, testClient, "123 --force"))
241 // Local branch ref must now match remote.
242 assert.Equal(t, remoteSHA, gitOutput(t, workDir, "rev-parse", "HEAD"))
243 // Reflog proves it was a reset (not branch delete + recreate).
244 reflog := gitOutput(t, workDir, "reflog", "show", "feat-new-mr")
245 assert.Contains(t, reflog, "reset")
246 })
248 t.Run("--force, on target branch, tracked modification refuses", func(t *testing.T) {
249 originDir, workDir, _, localSHA := setupDivergedRepo(t)
250 t.Chdir(workDir)
252 // Introduce uncommitted change to a TRACKED file.
253 require.NoError(t, os.WriteFile(filepath.Join(workDir, "local.txt"), []byte("local edit\n"), 0o644))
255 testClient := mockCheckoutMR(t, originDir)
256 err := execCheckout(t, testClient, "123 --force")
258 require.Error(t, err)
259 assert.Contains(t, err.Error(), "changes that would be lost")
260 // HEAD still at local SHA — refusal preserved branch state.
261 assert.Equal(t, localSHA, gitOutput(t, workDir, "rev-parse", "HEAD"))
262 // Modified file still has user's edit.
263 assert.Equal(t, "local edit\n", readFile(t, filepath.Join(workDir, "local.txt")))
264 })
266 t.Run("--force, on target, unrelated untracked file is allowed", func(t *testing.T) {
267 originDir, workDir, remoteSHA, _ := setupDivergedRepo(t)
268 t.Chdir(workDir)
270 // Untracked file with path NOT present in FETCH_HEAD's tree (which contains
271 // only remote.txt). reset --hard leaves it alone.
272 require.NoError(t, os.WriteFile(filepath.Join(workDir, "notes.txt"), []byte("personal notes\n"), 0o644))
274 testClient := mockCheckoutMR(t, originDir)
275 require.NoError(t, execCheckout(t, testClient, "123 --force"))
277 // Branch matches remote.
278 assert.Equal(t, remoteSHA, gitOutput(t, workDir, "rev-parse", "HEAD"))
279 // Untracked file survived the reset.
280 assert.Equal(t, "personal notes\n", readFile(t, filepath.Join(workDir, "notes.txt")))
281 })
283 t.Run("--force, on target, untracked file conflicts with incoming refuses", func(t *testing.T) {
284 originDir, workDir, _, localSHA := setupDivergedRepo(t)
285 t.Chdir(workDir)
287 // Untracked file with same path as incoming tracked file (remote.txt is in
288 // FETCH_HEAD's tree). reset --hard would silently overwrite — we must block.
289 require.NoError(t, os.WriteFile(filepath.Join(workDir, "remote.txt"), []byte("LOCAL UNTRACKED\n"), 0o644))
291 testClient := mockCheckoutMR(t, originDir)
292 err := execCheckout(t, testClient, "123 --force")
294 require.Error(t, err)
295 assert.Contains(t, err.Error(), "changes that would be lost")
296 // HEAD untouched.
297 assert.Equal(t, localSHA, gitOutput(t, workDir, "rev-parse", "HEAD"))
298 // Local untracked content preserved.
299 assert.Equal(t, "LOCAL UNTRACKED\n", readFile(t, filepath.Join(workDir, "remote.txt")))
300 })
302 t.Run("--force, not on target branch, updates ref and switches", func(t *testing.T) {
303 originDir, workDir, remoteSHA, _ := setupDivergedRepo(t)
304 // Switch back to main so we are NOT on the target branch.
305 runGit(t, workDir, "checkout", "main")
306 t.Chdir(workDir)
307 require.Equal(t, "main", gitOutput(t, workDir, "symbolic-ref", "--short", "HEAD"))
309 testClient := mockCheckoutMR(t, originDir)
310 require.NoError(t, execCheckout(t, testClient, "123 --force"))
312 // Now on feat-new-mr at remote SHA.
313 assert.Equal(t, "feat-new-mr", gitOutput(t, workDir, "symbolic-ref", "--short", "HEAD"))
314 assert.Equal(t, remoteSHA, gitOutput(t, workDir, "rev-parse", "HEAD"))
315 })
316}
318func Test_MRCheckout_TracksMatchingRemote_Integration(t *testing.T) {
319 originDir, workDir, _, _ := setupDivergedRepo(t)
320 runGit(t, workDir, "checkout", "main")
321 runGit(t, workDir, "branch", "-D", "feat-new-mr")
322 remoteSHA := gitOutput(t, originDir, "rev-parse", "refs/heads/feat-new-mr")
323 originURL := serveOrigin(t, originDir)
324 runGit(t, workDir, "remote", "add", "origin", originURL)
325 t.Chdir(workDir)
327 testClient := gitlabtesting.NewTestClient(t)
328 testClient.MockMergeRequests.EXPECT().
329 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any(), gomock.Any()).
330 Return(&gitlab.MergeRequest{
331 BasicMergeRequest: gitlab.BasicMergeRequest{
332 ID: 123, IID: 123, ProjectID: 3, SourceProjectID: 3,
333 SourceBranch: "feat-new-mr", State: "opened", SHA: remoteSHA,
334 },
335 }, nil, nil)
336 testClient.MockProjects.EXPECT().
337 GetProject(gomock.Any(), gomock.Any()).
338 Return(&gitlab.Project{
339 ID: 3, PathWithNamespace: "OWNER/REPO",
340 SSHURLToRepo: originURL, HTTPURLToRepo: originURL,
341 }, nil, nil)
343 withRemote := func(f *cmdtest.Factory) {
344 f.RemotesStub = func() (glrepo.Remotes, error) {
345 return glrepo.Remotes{{
346 Remote: &git.Remote{Name: "origin", Resolved: "base"},
347 Repo: glrepo.New("OWNER", "REPO", glinstance.DefaultHostname),
348 }}, nil
349 }
350 }
351 ios, _, stdout, stderr := cmdtest.TestIOStreams()
352 f := cmdtest.NewTestFactory(ios, cmdtest.WithGitLabClient(testClient.Client), withRemote)
353 _, err := cmdtest.ExecuteCommand(NewCmdCheckout(f), "123", stdout, stderr)
354 require.NoError(t, err, "stderr=%s", stderr.String())
356 assert.Equal(t, "origin", gitOutput(t, workDir, "config", "branch.feat-new-mr.remote"))
357 assert.Equal(t, "origin/feat-new-mr", gitOutput(t, workDir, "rev-parse", "--abbrev-ref", "feat-new-mr@{u}"))
358}
Diagnostics8 git calls · 247 ms
CallStatusSizeTime0247 ms
discover200185 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=185 git.server.agent=git/2.56.g1891de4-Linux git.server.object_format=sha1 git.server.caps=agent ls-refs fetch server-option object-format git.server.fetch=shallow wait-for-done filter git.protocol.version=2 git.pkt.frames=9 git.pkt.data=7 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=185 git.pkt.payload.max=35
ls-refs20058 KiB · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=59849 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=731 git.pkt.data=730 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=59849 git.pkt.payload.max=143 git.ls_refs.count=730 git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 1020032 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=32926 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=22 git.pkt.data=20 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=32926 git.pkt.payload.max=32046 git.sideband.band1.bytes=32046 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=80 git.pack.bytes=32046 git.pack.ofs_delta=36 git.pack.ref_delta=0 git.pack.chain.max=2 git.pack.trailer=cb0bad5d7ffc514895d8b21c4dd470327f90bc91 git.pack.full=44Open pack map
fetchcombine:blob:none+tree:2 · deepen 12004.2 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=4273 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=combine:blob:none+tree:2 git.fetch.wants=0dd7574dce9e385c5c30540e6c15657adc6bdce9 git.fetch.haves.count=0 git.fetch.deepen=1 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=4273 git.pkt.payload.max=4173 git.sideband.band1.bytes=4173 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=11 git.pack.bytes=4173 git.fetch.wide.objects=11 git.fetch.wide.extra_bytes=3930 git.fetch.wide.blobs=0
fetchtree:02001.8 KiB · hit5 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=5 git.response.bytes=1857 git.response.cache=HIT git.response.duration_ms=5 git.fetch.filter=tree:0 git.fetch.wants=dce174ff8c632a19d17eea99c8a9b7c37fb2b592 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=1857 git.pkt.payload.max=1830 git.sideband.band1.bytes=1830 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=1830 git.pack.trailer=fb03183b7909876778f740d196d7516811003517Open pack map
fetchtree:0200746 B · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=746 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=f3d413a22af5a9c2fe9aa49709b1cb36d1351a7f git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=746 git.pkt.payload.max=719 git.sideband.band1.bytes=719 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=719 git.pack.trailer=330baf80c59a4208b55120dff7dd824b7952b790Open pack map
fetchtree:0200180 B · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=180 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=798b94905ec5caf72269567e97fe6dba32b63a3c git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=180 git.pkt.payload.max=153 git.sideband.band1.bytes=153 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=153 git.pack.trailer=0357626d2605d28d1849d8be9216332c1b4ca495Open pack map
fetch2003.4 KiB231 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=231 git.response.bytes=3503 git.response.cache=MISS git.response.duration_ms=231 git.fetch.wants=0cc5d6c36989febf9a3ecbfe28043b2820f65ee0 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=3503 git.pkt.payload.max=3476 git.sideband.band1.bytes=3476 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://gitlab.com/gitlab-org/cli
- Ref
- refs/heads/main
- Commit
- 0dd7574dce9e385c5c30540e6c15657adc6bdce9
- cf-ray
- a5e30a3d6cc6ee28
- Request
- 8b158479…
- Protocol
- v2 · sha1
- Agent
- git/2.56.g1891de4-Linux
- Filter
- advertised
- Fetch
- shallow wait-for-done filter
- Capabilities
- agent ls-refs fetch server-option object-format