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:
authorToon Claes <toon@gitlab.com>2022-08-26 18:03:10 +0300
committerToon Claes <toon@gitlab.com>2022-10-03 12:46:38 +0300
commita7d8c5fadafb723c7d35e5d9725fed04f9bf074f (patch)
treefad9cd28dad18b60012e96ba440459bb7b000eca
parent3b8c7e1ac249135f4f4d03407fffd7be86c361e9 (diff)
repository: Nickname "Other" license to "LICENSE"
The nickname is used as primary source for the text in the license badge in the UI. Using "LICENSE" is a lot more informative than "Other"
-rw-r--r--internal/gitaly/service/repository/license.go1
-rw-r--r--internal/gitaly/service/repository/license_test.go2
-rw-r--r--ruby/lib/gitaly_server/repository_service.rb1
3 files changed, 4 insertions, 0 deletions
diff --git a/internal/gitaly/service/repository/license.go b/internal/gitaly/service/repository/license.go
index 900c1fa89..2eceece15 100644
--- a/internal/gitaly/service/repository/license.go
+++ b/internal/gitaly/service/repository/license.go
@@ -61,6 +61,7 @@ func (s *server) FindLicense(ctx context.Context, req *gitalypb.FindLicenseReque
return &gitalypb.FindLicenseResponse{
LicenseName: "Other",
LicenseShortName: "other",
+ LicenseNickname: "LICENSE", // Show as LICENSE in the UI
LicensePath: repoFiler.path,
}, nil
}
diff --git a/internal/gitaly/service/repository/license_test.go b/internal/gitaly/service/repository/license_test.go
index b4b6709ff..3f000e80e 100644
--- a/internal/gitaly/service/repository/license_test.go
+++ b/internal/gitaly/service/repository/license_test.go
@@ -91,11 +91,13 @@ SOFTWARE.`,
expectedLicenseRuby: &gitalypb.FindLicenseResponse{
LicenseShortName: "other",
LicenseName: "Other",
+ LicenseNickname: "LICENSE",
LicensePath: "LICENSE.md",
},
expectedLicenseGo: &gitalypb.FindLicenseResponse{
LicenseShortName: "other",
LicenseName: "Other",
+ LicenseNickname: "LICENSE",
LicensePath: "LICENSE.md",
},
},
diff --git a/ruby/lib/gitaly_server/repository_service.rb b/ruby/lib/gitaly_server/repository_service.rb
index 20197cd43..98cb8b748 100644
--- a/ruby/lib/gitaly_server/repository_service.rb
+++ b/ruby/lib/gitaly_server/repository_service.rb
@@ -21,6 +21,7 @@ module GitalyServer
license_nickname: license.nickname || ""
).tap do |resp|
if license.key == "other"
+ resp.license_nickname = "LICENSE"
resp.license_url = ""
end
end