Skip to content

Commit ddcb65a

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 1e6730a commit ddcb65a

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Portions of this software are licensed as follows:
44

55
* All content residing under the "doc/" directory of this repository is licensed under "Creative Commons: CC BY-SA 4.0 license".
66
* All content that resides under the "ee/" directory of this repository, if that directory exists, is licensed under the license defined in "ee/LICENSE".
7+
* All content that resides under the "jh/" directory of this repository, if that directory exists, is licensed under the license defined in "jh/LICENSE".
78
* All client-side JavaScript (when served directly or after being compiled, arranged, augmented, or combined), is licensed under the "MIT Expat" license.
89
* All third party components incorporated into the GitLab Software are licensed under the original license provided by the owner of the applicable component.
910
* Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ To see how GitLab looks please see the [features page on our website](https://ab
2323

2424
## Editions
2525

26-
There are two editions of GitLab:
26+
There are three editions of GitLab:
2727

2828
- GitLab Community Edition (CE) is available freely under the MIT Expat license.
2929
- GitLab Enterprise Edition (EE) includes [extra features](https://about.gitlab.com/pricing/#compare-options) that are more useful for organizations with more than 100 users. To use EE and get official support please [become a subscriber](https://about.gitlab.com/pricing/).
30+
- JiHu Edition (JH) tailored specifically for the [Chinese market](https://about.gitlab.cn/).
3031

3132
## Licensing
3233

app/helpers/commits_helper.rb

+8
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ def commit_partial_cache_key(commit, ref:, merge_request:, request:)
167167
]
168168
end
169169

170+
DEFAULT_SHA = '0000000'
171+
172+
# Returns the template path for commit resources
173+
# to be utilized by the client applications.
174+
def commit_path_template(project)
175+
project_commit_path(project, DEFAULT_SHA).sub("/#{DEFAULT_SHA}", '/$COMMIT_SHA')
176+
end
177+
170178
protected
171179

172180
# Private: Returns a link to a person. If the person has a matching user and

spec/helpers/commits_helper_spec.rb

+9
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,13 @@ def standard_expected_data
321321
it { is_expected.to include(pipeline.cache_key) }
322322
end
323323
end
324+
325+
describe "#commit_path_template" do
326+
let(:project) { build(:project) }
327+
let(:expected_path) { "/#{project.full_path}/-/commit/$COMMIT_SHA" }
328+
329+
subject { helper.commit_path_template(project) }
330+
331+
it { is_expected.to eq(expected_path) }
332+
end
324333
end

0 commit comments

Comments
 (0)