GitLabgitlab-org
cli
main
1//go:build !integration
3package diff
5import (
6 "bytes"
7 "io"
8 "net/http"
9 "strings"
10 "testing"
12 "github.com/MakeNowJust/heredoc/v2"
13 "github.com/google/shlex"
14 "github.com/spf13/cobra"
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/cmdutils"
23 "gitlab.com/gitlab-org/cli/internal/testing/cmdtest"
24)
26func Test_NewCmdDiff(t *testing.T) {
27 tests := []struct {
28 name string
29 args string
30 isTTY bool
31 want options
32 wantErr string
33 }{
34 {
35 name: "number argument",
36 args: "123",
37 isTTY: true,
38 want: options{
39 args: []string{"123"},
40 useColor: "auto",
41 },
42 },
43 {
44 name: "no argument",
45 args: "",
46 isTTY: true,
47 want: options{
48 useColor: "auto",
49 },
50 },
51 {
52 name: "no color when redirected",
53 args: "",
54 isTTY: false,
55 want: options{
56 useColor: "never",
57 },
58 },
59 {
60 name: "no argument with --repo override",
61 args: "-R owner/repo",
62 isTTY: true,
63 wantErr: "argument required when using the --repo flag",
64 },
65 {
66 name: "invalid --color argument",
67 args: "--color doublerainbow",
68 isTTY: true,
69 wantErr: `did not understand color "doublerainbow": expected one of 'always', 'never', or 'auto'`,
70 },
71 }
72 for _, tt := range tests {
73 t.Run(tt.name, func(t *testing.T) {
74 ios, _, _, _ := cmdtest.TestIOStreams(cmdtest.WithTestIOStreamsAsTTY(tt.isTTY))
76 f := cmdtest.NewTestFactory(ios)
78 var opts *options
79 cmd := NewCmdDiff(f, func(o *options) error {
80 opts = o
81 return nil
82 })
83 cmd.PersistentFlags().StringP("repo", "R", "", "")
85 argv, err := shlex.Split(tt.args)
86 require.NoError(t, err)
87 cmd.SetArgs(argv)
89 cmd.SetIn(&bytes.Buffer{})
90 cmd.SetOut(io.Discard)
91 cmd.SetErr(io.Discard)
93 _, err = cmd.ExecuteC()
94 if tt.wantErr != "" {
95 require.EqualError(t, err, tt.wantErr)
96 return
97 } else {
98 require.NoError(t, err)
99 }
101 assert.Equal(t, tt.want.args, opts.args)
102 assert.Equal(t, tt.want.useColor, opts.useColor)
103 })
104 }
105}
107// newCmdDiffWrapper wraps NewCmdDiff to match cmdtest.CmdFunc signature
108func newCmdDiffWrapper(f cmdutils.Factory) *cobra.Command {
109 return NewCmdDiff(f, nil)
110}
112func TestMRDiff_raw(t *testing.T) {
113 t.Parallel()
115 testClient := gitlabtesting.NewTestClient(t)
117 // Mock GetMergeRequest
118 testClient.MockMergeRequests.EXPECT().
119 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any()).
120 Return(&gitlab.MergeRequest{
121 BasicMergeRequest: gitlab.BasicMergeRequest{
122 ID: 123,
123 IID: 123,
124 ProjectID: 3,
125 Title: "test1",
126 Description: "fixed login page css paddings",
127 State: "merged",
128 },
129 }, nil, nil)
131 rawDiff := heredoc.Doc(`
132 diff --git a/file.txt b/file.txt
133 index 123..456 100644
134 --- a/file.txt
135 +++ b/file.txt
136 @@ -1 +1 @@
137 -old line
138 +new line`)
140 // Mock ShowMergeRequestRawDiffs
141 testClient.MockMergeRequests.EXPECT().
142 ShowMergeRequestRawDiffs("OWNER/REPO", int64(123), gomock.Any()).
143 Return([]byte(rawDiff), nil, nil)
145 exec := cmdtest.SetupCmdForTest(t, newCmdDiffWrapper, false,
146 cmdtest.WithGitLabClient(testClient.Client),
147 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
148 )
150 output, err := exec("123 --raw")
151 require.NoError(t, err)
152 assert.Equal(t, rawDiff, output.String())
153 assert.Empty(t, output.Stderr())
154}
156func TestMRDiff_no_current_mr(t *testing.T) {
157 t.Parallel()
159 testClient := gitlabtesting.NewTestClient(t)
161 // Mock ListProjectMergeRequests - returns empty list (no MR for branch)
162 testClient.MockMergeRequests.EXPECT().
163 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
164 Return([]*gitlab.BasicMergeRequest{}, nil, nil)
166 exec := cmdtest.SetupCmdForTest(t, newCmdDiffWrapper, false,
167 cmdtest.WithGitLabClient(testClient.Client),
168 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
169 cmdtest.WithBranch("feature"),
170 )
172 _, err := exec("")
173 require.Error(t, err)
174 assert.Equal(t, `no open merge request available for "feature"`, err.Error())
175}
177func TestMRDiff_argument_not_found(t *testing.T) {
178 t.Parallel()
180 testClient := gitlabtesting.NewTestClient(t)
182 // Mock GetMergeRequest
183 testClient.MockMergeRequests.EXPECT().
184 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any()).
185 Return(&gitlab.MergeRequest{
186 BasicMergeRequest: gitlab.BasicMergeRequest{
187 ID: 123,
188 IID: 123,
189 ProjectID: 3,
190 Title: "test1",
191 Description: "fixed login page css paddings",
192 State: "merged",
193 },
194 }, nil, nil)
196 // Mock GetMergeRequestDiffVersions - returns 404
197 notFoundResp := &gitlab.Response{
198 Response: &http.Response{StatusCode: http.StatusNotFound},
199 }
200 testClient.MockMergeRequests.EXPECT().
201 GetMergeRequestDiffVersions("OWNER/REPO", int64(123), gomock.Any()).
202 Return(nil, notFoundResp, gitlab.ErrNotFound)
204 exec := cmdtest.SetupCmdForTest(t, newCmdDiffWrapper, false,
205 cmdtest.WithGitLabClient(testClient.Client),
206 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
207 )
209 output, err := exec("123")
210 require.Error(t, err)
211 assert.Empty(t, output.String())
212 assert.Empty(t, output.Stderr())
213 assert.Contains(t, err.Error(), "could not find merge request diffs")
214}
216func TestMRDiff_notty(t *testing.T) {
217 t.Parallel()
219 testClient := gitlabtesting.NewTestClient(t)
221 // Mock ListProjectMergeRequests - find MR by branch
222 testClient.MockMergeRequests.EXPECT().
223 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
224 Return([]*gitlab.BasicMergeRequest{{
225 ID: 123,
226 IID: 123,
227 ProjectID: 3,
228 Title: "test1",
229 Description: "fixed login page css paddings",
230 State: "merged",
231 }}, nil, nil)
233 // Mock GetMergeRequest
234 testClient.MockMergeRequests.EXPECT().
235 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any()).
236 Return(&gitlab.MergeRequest{
237 BasicMergeRequest: gitlab.BasicMergeRequest{
238 ID: 123,
239 IID: 123,
240 ProjectID: 3,
241 Title: "test1",
242 Description: "fixed login page css paddings",
243 State: "merged",
244 },
245 }, nil, nil)
247 // Mock GetMergeRequestDiffVersions
248 testClient.MockMergeRequests.EXPECT().
249 GetMergeRequestDiffVersions("OWNER/REPO", int64(123), gomock.Any()).
250 Return([]*gitlab.MergeRequestDiffVersion{
251 {
252 ID: 110,
253 HeadCommitSHA: "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
254 BaseCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
255 StartCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
256 State: "collected",
257 RealSize: "1",
258 },
259 }, nil, nil)
261 // Mock GetSingleMergeRequestDiffVersion
262 testClient.MockMergeRequests.EXPECT().
263 GetSingleMergeRequestDiffVersion("OWNER/REPO", int64(123), int64(110), gomock.Any()).
264 Return(&gitlab.MergeRequestDiffVersion{
265 ID: 110,
266 HeadCommitSHA: "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
267 BaseCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
268 StartCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
269 State: "collected",
270 RealSize: "1",
271 Diffs: []*gitlab.Diff{
272 {
273 OldPath: "LICENSE",
274 NewPath: "LICENSE",
275 AMode: "0",
276 BMode: "100644",
277 Diff: "@@ -0,0 +1,21 @@\n+The MIT License (MIT)\n+\n+Copyright (c) 2018 Administrator\n+\n+Permission is hereby granted, free of charge, to any person obtaining a copy\n+of this software and associated documentation files (the \"Software\"), to deal\n+in the Software without restriction, including without limitation the rights\n+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+copies of the Software, and to permit persons to whom the Software is\n+furnished to do so, subject to the following conditions:\n+\n+The above copyright notice and this permission notice shall be included in all\n+copies or substantial portions of the Software.\n+\n+THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+SOFTWARE.\n",
278 NewFile: true,
279 RenamedFile: false,
280 DeletedFile: false,
281 },
282 {
283 OldPath: "OLD_FILE",
284 NewPath: "OLD_FILE",
285 AMode: "100644",
286 BMode: "0",
287 Diff: "@@ -1,1 +0,0 @@\n-Deleted content\n",
288 NewFile: false,
289 RenamedFile: false,
290 DeletedFile: true,
291 },
292 {
293 OldPath: "OLD_NAME",
294 NewPath: "NEW_NAME",
295 AMode: "100644",
296 BMode: "100644",
297 Diff: "@@ -1,1 +1,1 @@\n-old\n+new\n",
298 NewFile: false,
299 RenamedFile: true,
300 DeletedFile: false,
301 },
302 },
303 }, nil, nil)
305 exec := cmdtest.SetupCmdForTest(t, newCmdDiffWrapper, false,
306 cmdtest.WithGitLabClient(testClient.Client),
307 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
308 cmdtest.WithBranch("feature"),
309 )
311 output, err := exec("")
312 require.NoError(t, err)
314 assert.Contains(t, output.String(), "diff --git a/LICENSE b/LICENSE\nnew file mode 100644\n--- /dev/null\n+++ b/LICENSE\n")
315 assert.Contains(t, output.String(), "+The MIT License (MIT)")
316 assert.Contains(t, output.String(), "+FITNESS")
318 assert.Contains(t, output.String(), "diff --git a/OLD_FILE b/OLD_FILE\ndeleted file mode 100644\n--- a/OLD_FILE\n+++ /dev/null\n")
319 assert.Contains(t, output.String(), "-Deleted content")
321 assert.Contains(t, output.String(), "diff --git a/OLD_NAME b/NEW_NAME\nrename from OLD_NAME\nrename to NEW_NAME\n--- a/OLD_NAME\n+++ b/NEW_NAME\n")
322 assert.Contains(t, output.String(), "-old")
323 assert.Contains(t, output.String(), "+new")
324}
326func TestMRDiff_tty(t *testing.T) {
327 t.Parallel()
329 testClient := gitlabtesting.NewTestClient(t)
330 longLine := "+" + strings.Repeat("x", 70*1024)
332 // Mock ListProjectMergeRequests - find MR by branch
333 testClient.MockMergeRequests.EXPECT().
334 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
335 Return([]*gitlab.BasicMergeRequest{{
336 ID: 123,
337 IID: 123,
338 ProjectID: 3,
339 Title: "test1",
340 Description: "fixed login page css paddings",
341 State: "merged",
342 }}, nil, nil)
344 // Mock GetMergeRequest
345 testClient.MockMergeRequests.EXPECT().
346 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any()).
347 Return(&gitlab.MergeRequest{
348 BasicMergeRequest: gitlab.BasicMergeRequest{
349 ID: 123,
350 IID: 123,
351 ProjectID: 3,
352 Title: "test1",
353 Description: "fixed login page css paddings",
354 State: "merged",
355 },
356 }, nil, nil)
358 // Mock GetMergeRequestDiffVersions
359 testClient.MockMergeRequests.EXPECT().
360 GetMergeRequestDiffVersions("OWNER/REPO", int64(123), gomock.Any()).
361 Return([]*gitlab.MergeRequestDiffVersion{
362 {
363 ID: 110,
364 HeadCommitSHA: "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
365 BaseCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
366 StartCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
367 State: "collected",
368 RealSize: "1",
369 },
370 }, nil, nil)
372 // Mock GetSingleMergeRequestDiffVersion
373 testClient.MockMergeRequests.EXPECT().
374 GetSingleMergeRequestDiffVersion("OWNER/REPO", int64(123), int64(110), gomock.Any()).
375 Return(&gitlab.MergeRequestDiffVersion{
376 ID: 110,
377 HeadCommitSHA: "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
378 BaseCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
379 StartCommitSHA: "eeb57dffe83deb686a60a71c16c32f71046868fd",
380 State: "collected",
381 RealSize: "1",
382 Diffs: []*gitlab.Diff{{
383 OldPath: "LICENSE.md",
384 NewPath: "LICENSE",
385 AMode: "0",
386 BMode: "100644",
387 Diff: "@@ -0,0 +1,2 @@\n+The MIT License (MIT)\n" + longLine + "\n",
388 NewFile: true,
389 RenamedFile: false,
390 DeletedFile: false,
391 }},
392 }, nil, nil)
394 exec := cmdtest.SetupCmdForTest(t, newCmdDiffWrapper, true,
395 cmdtest.WithGitLabClient(testClient.Client),
396 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
397 cmdtest.WithBranch("feature"),
398 )
400 output, err := exec("")
401 require.NoError(t, err)
402 // TTY output should have color codes
403 assert.Contains(t, output.String(), "\x1b[32m+The MIT License")
404 assert.Contains(t, output.String(), longLine)
405}
407func TestMRDiff_no_diffs_found(t *testing.T) {
408 t.Parallel()
410 testClient := gitlabtesting.NewTestClient(t)
412 // Mock ListProjectMergeRequests - find MR by branch
413 testClient.MockMergeRequests.EXPECT().
414 ListProjectMergeRequests("OWNER/REPO", gomock.Any()).
415 Return([]*gitlab.BasicMergeRequest{{
416 ID: 123,
417 IID: 123,
418 ProjectID: 3,
419 Title: "test1",
420 Description: "fixed login page css paddings",
421 State: "merged",
422 }}, nil, nil)
424 // Mock GetMergeRequest
425 testClient.MockMergeRequests.EXPECT().
426 GetMergeRequest("OWNER/REPO", int64(123), gomock.Any()).
427 Return(&gitlab.MergeRequest{
428 BasicMergeRequest: gitlab.BasicMergeRequest{
429 ID: 123,
430 IID: 123,
431 ProjectID: 3,
432 Title: "test1",
433 Description: "fixed login page css paddings",
434 State: "merged",
435 },
436 }, nil, nil)
438 // Mock GetMergeRequestDiffVersions - returns empty list
439 testClient.MockMergeRequests.EXPECT().
440 GetMergeRequestDiffVersions("OWNER/REPO", int64(123), gomock.Any()).
441 Return([]*gitlab.MergeRequestDiffVersion{}, nil, nil)
443 exec := cmdtest.SetupCmdForTest(t, newCmdDiffWrapper, false,
444 cmdtest.WithGitLabClient(testClient.Client),
445 cmdtest.WithBaseRepo("OWNER", "REPO", ""),
446 cmdtest.WithBranch("feature"),
447 )
449 _, err := exec("")
450 require.Error(t, err)
451 assert.Equal(t, "no merge request diffs found", err.Error())
452}
Diagnostics8 git calls · 281 ms
CallStatusSizeTime0281 ms
discover200185 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 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 · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=59849 git.response.cache=HIT git.response.duration_ms=2 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
fetchcombine:blob:none+tree:2 · deepen 12004.2 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=4273 git.response.cache=HIT git.response.duration_ms=2 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: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=1 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
fetchtree:02001.8 KiB · hit1 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=1857 git.response.cache=HIT git.response.duration_ms=1 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 · hit3 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=3 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:0200136 B · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=270 git.response.bytes=136 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=8d144ed38cf935c4def8f07fe1832acf89ea7583 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=136 git.pkt.payload.max=109 git.sideband.band1.bytes=109 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=109 git.pack.trailer=6bea258413f6de0b4ea7e49b6d6c1baeaa503210Open pack map
fetch2003.1 KiB270 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=3191 git.response.cache=MISS git.response.duration_ms=270 git.fetch.wants=59cd879f964d9c3cece05785df4133ee06d5477a 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=3191 git.pkt.payload.max=3164 git.sideband.band1.bytes=3164 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
- a5e250f12b4eb071
- Request
- d321d299…
- 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