Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/gitaly/linguist/linguist_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/gitaly/linguist/linguist_test.go b/internal/gitaly/linguist/linguist_test.go
index 5d0ae925e..6ac60fe55 100644
--- a/internal/gitaly/linguist/linguist_test.go
+++ b/internal/gitaly/linguist/linguist_test.go
@@ -426,6 +426,34 @@ func testInstanceStats(t *testing.T, ctx context.Context) {
},
},
{
+ desc: "buggy behavior",
+ setup: func(t *testing.T) (*gitalypb.Repository, string, git.ObjectID) {
+ repoProto, repoPath := gittest.CreateRepository(ctx, t, cfg, gittest.CreateRepositoryConfig{
+ SkipCreationViaService: true,
+ })
+
+ amdTree := gittest.WriteTree(t, cfg, repoPath, []gittest.TreeEntry{
+ {Path: "ffx_a.h", Mode: "100644", Content: strings.Repeat("a", 349)},
+ })
+ thirdPartyTree := gittest.WriteTree(t, cfg, repoPath, []gittest.TreeEntry{
+ {Path: "README.md", Mode: "100644", Content: strings.Repeat("a", 234)},
+ {Path: "amd-fsr", Mode: "040000", OID: amdTree},
+ })
+
+ commitID := gittest.WriteCommit(t, cfg, repoPath, gittest.WithTreeEntries(
+ gittest.TreeEntry{Path: "thirdparty", Mode: "040000", OID: thirdPartyTree},
+ gittest.TreeEntry{
+ Path: ".gitattributes",
+ Mode: "100644",
+ Content: "*.h linguist-language=cpp\nthirdparty/* linguist-vendored",
+ },
+ ))
+
+ return repoProto, repoPath, commitID
+ },
+ expectedStats: ByteCountPerLanguage{},
+ },
+ {
desc: "corrupted cache",
setup: func(t *testing.T) (*gitalypb.Repository, string, git.ObjectID) {
repoProto, repoPath := gittest.CreateRepository(ctx, t, cfg, gittest.CreateRepositoryConfig{