From b0697bbec9f7c47562628785a085db497b9f3ee1 Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Thu, 16 Jan 2025 12:20:23 -0500 Subject: [PATCH] Fix test --- private/buf/buffetch/ref_parser_test.go | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/private/buf/buffetch/ref_parser_test.go b/private/buf/buffetch/ref_parser_test.go index 404c1b7f2e..b239666b24 100644 --- a/private/buf/buffetch/ref_parser_test.go +++ b/private/buf/buffetch/ref_parser_test.go @@ -257,6 +257,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir.git", ) @@ -270,6 +271,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 40, "", + "", ), "path/to/dir.git#depth=40", ) @@ -283,6 +285,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir.git#branch=main", ) @@ -296,6 +299,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "file:///path/to/dir.git#branch=main", ) @@ -309,6 +313,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir.git#tag=v1.0.0", ) @@ -322,6 +327,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "http://hello.com/path/to/dir.git#branch=main", ) @@ -335,6 +341,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "https://hello.com/path/to/dir.git#branch=main", ) @@ -348,6 +355,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "ssh://user@hello.com:path/to/dir.git#branch=main", ) @@ -361,6 +369,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 50, "", + "", ), "ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD", ) @@ -374,6 +383,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 50, "", + "", ), "ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD,branch=main", ) @@ -387,6 +397,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 10, "", + "", ), "ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD,depth=10", ) @@ -400,6 +411,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 10, "", + "", ), "ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD,branch=main,depth=10", ) @@ -413,6 +425,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "foo/bar", + "", ), "path/to/dir.git#subdir=foo/bar", ) @@ -426,6 +439,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir.git#subdir=.", ) @@ -439,6 +453,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir.git#subdir=foo/..", ) @@ -452,6 +467,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "git://user@hello.com:path/to/dir.git#branch=main", ) @@ -465,9 +481,24 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "git://path/to/dir.git#branch=main", ) + testGetParsedRefSuccess( + t, + internal.NewDirectParsedGitRef( + formatGit, + "path/to/dir.git", + internal.GitSchemeGit, + git.NewBranchName("main"), + false, + 1, + "subdir", + "tree:0", + ), + "git://path/to/dir.git#branch=main,filter=tree:0,subdir=subdir", + ) testGetParsedRefSuccess( t, internal.NewDirectParsedSingleRef( @@ -811,6 +842,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "/path/to/dir#branch=main,format=git", ) @@ -824,6 +856,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "/path/to/dir#format=git,branch=main/foo", ) @@ -837,6 +870,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir#tag=main/foo,format=git", ) @@ -850,6 +884,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir#format=git,tag=main/foo", ) @@ -863,6 +898,7 @@ func TestGetParsedRefSuccess(t *testing.T) { true, 1, "", + "", ), "path/to/dir#format=git,tag=main/foo,recurse_submodules=true", ) @@ -876,6 +912,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 1, "", + "", ), "path/to/dir#format=git,tag=main/foo,recurse_submodules=false", ) @@ -889,6 +926,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 50, "", + "", ), "path/to/dir#format=git,ref=refs/remotes/origin/HEAD", ) @@ -902,6 +940,7 @@ func TestGetParsedRefSuccess(t *testing.T) { false, 10, "", + "", ), "path/to/dir#format=git,ref=refs/remotes/origin/HEAD,depth=10", )